Documentation ¶ Overview ¶ Package syncutil holds synchronization helpers the standard library lacks. Index ¶ type WaitGroup func (g *WaitGroup) Add(delta int) func (g *WaitGroup) Done() func (g *WaitGroup) Go(f func()) func (g *WaitGroup) Wait(ctx context.Context) error Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type WaitGroup ¶ type WaitGroup struct { // contains filtered or unexported fields } WaitGroup counts goroutines like sync.WaitGroup, but Wait gives up once its context ends, and Add may come at any time, even while a Wait that gave up has left its count going. func (*WaitGroup) Add ¶ func (g *WaitGroup) Add(delta int) func (*WaitGroup) Done ¶ func (g *WaitGroup) Done() func (*WaitGroup) Go ¶ func (g *WaitGroup) Go(f func()) Go runs f in a goroutine the group counts. func (*WaitGroup) Wait ¶ func (g *WaitGroup) Wait(ctx context.Context) error Wait returns nil once the count drops to zero, or ctx's error if ctx ends first. Source Files ¶ View all Source files waitgroup.go Click to show internal directories. Click to hide internal directories.