Misusing sync.WaitGroup (#71)
Official 100go entry on correct add/done/wait ownership and lifecycle for `sync.WaitGroup`.
Official 100go entry on correct add/done/wait ownership and lifecycle for sync.WaitGroup.
- Author: Teiva Harsanyi
- Authority: community
- Kind: guide
- URL: https://100go.co/#misusing-syncwaitgroup-71
What it covers
- Add/Done ordering
- ownership of WaitGroup
- goroutine coordination pitfalls
Why authoritative
Official 100go website entry for this specific mistake.
Use when
- is this WaitGroup usage correct
- where should WaitGroup.Add be called
- what are common WaitGroup bugs in Go
Keywords
- WaitGroup, sync.WaitGroup, goroutines, coordination, Add Done Wait