Skip to content

Glossary: Go Beyond the Basics

WaitGroup

Also written: sync.WaitGroup, wg.Go, wg.Wait

A counter from package `sync` that waits for a group of goroutines. `wg.Go(f)` starts and counts a goroutine, and `wg.Wait()` blocks until all have finished.

Where the book teaches it

Related terms

goroutineerrgroupblock