Codebase list golang-github-vbauerster-mpb / 9f86001
better comment for mpb.WithWaitGroup Vladimir Bauer 5 years ago
2 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
6565
6666 ```go
6767 var wg sync.WaitGroup
68 // pass &wg (optional), so p will wait for it eventually
68 // passed &wg will be accounted at p.Wait() call
6969 p := mpb.New(mpb.WithWaitGroup(&wg))
7070 total, numBars := 100, 3
7171 wg.Add(numBars)
1111
1212 func main() {
1313 var wg sync.WaitGroup
14 // pass &wg (optional), so p will wait for it eventually
14 // passed &wg will be accounted at p.Wait() call
1515 p := mpb.New(mpb.WithWaitGroup(&wg))
1616 total, numBars := 100, 3
1717 wg.Add(numBars)