📚Cheatsheets

Cheatsheet collection for go, rust 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()