4 ms·
I'm just saying in Go, the equivalent construct (WaitGroup) does not require you to figure out the count ahead of time. There's an idiom of: var wg sync.Wa
by klodolph 5y ago
I'm just saying in Go, the equivalent construct (WaitGroup) does not require you to figure out the count ahead of time. There's an idiom of:
var wg sync.WaitGroup
wg.Add(1)
go func() {
defer wg.Done()
}()
wg.Wait()
The middle part of the block can be done freely, you don't have to count the threads beforehand.