add (*Bar).Wait method
Vladimir Bauer
4 years ago
| 331 | 331 |
}
|
| 332 | 332 |
}
|
| 333 | 333 |
|
|
334 |
// Wait blocks until bar is completed or aborted.
|
|
335 |
func (b *Bar) Wait() {
|
|
336 |
<-b.done
|
|
337 |
}
|
|
338 |
|
| 334 | 339 |
func (b *Bar) serve(ctx context.Context, bs *bState) {
|
| 335 | 340 |
defer b.container.bwg.Done()
|
| 336 | 341 |
if bs.afterBar != nil && bs.sync {
|
| 29 | 29 |
}
|
| 30 | 30 |
|
| 31 | 31 |
b.SetTotal(100, true)
|
|
32 |
|
|
33 |
b.Wait()
|
| 32 | 34 |
|
| 33 | 35 |
if count := p.BarCount(); count != 0 {
|
| 34 | 36 |
t.Errorf("BarCount want: %d, got: %d\n", 0, count)
|