📚Cheatsheets

Cheatsheet collection for go, rust, python, shell and javascript.

WaitGroup

How to use wait group?

var wg sync.WaitGroup
wg.Add(16)
for i := 0; i < 16; i++ {
    go func(i int) {
        // do process
        wg.Done()
    }(i)
}
wg.Wait()