Codebase list golang-github-vbauerster-mpb / 625cae5
add (*Bar).Wait method Vladimir Bauer 4 years ago
2 changed file(s) with 7 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
331331 }
332332 }
333333
334 // Wait blocks until bar is completed or aborted.
335 func (b *Bar) Wait() {
336 <-b.done
337 }
338
334339 func (b *Bar) serve(ctx context.Context, bs *bState) {
335340 defer b.container.bwg.Done()
336341 if bs.afterBar != nil && bs.sync {
2929 }
3030
3131 b.SetTotal(100, true)
32
33 b.Wait()
3234
3335 if count := p.BarCount(); count != 0 {
3436 t.Errorf("BarCount want: %d, got: %d\n", 0, count)