Go · Class
sync.WaitGroup
sync.WaitGroup tracks unfinished goroutines or tasks. Call Go, or use Add and Done, then call Wait to block until the counter reaches zero.
Last updated
Syntax
type WaitGroup struct{}
func (wg *WaitGroup) Add(delta int)
func (wg *WaitGroup) Done()
func (wg *WaitGroup) Wait()
func (wg *WaitGroup) Go(f func())In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
sync.WaitGroup.Addsync.WaitGroup.Donesync.WaitGroup.Waitsync.WaitGroup.Go