use BarOptional
Vladimir Bauer
5 years ago
| 23 | 23 |
name := fmt.Sprintf("Bar#%d:", i)
|
| 24 | 24 |
bar := p.AddBar(int64(total),
|
| 25 | 25 |
// set BarWidth 40 for bar 1 and 2
|
| 26 | |
mpb.BarOptOn(mpb.BarWidth(40), func() bool { return i > 0 }),
|
|
26 |
mpb.BarOptional(mpb.BarWidth(40), i > 0),
|
| 27 | 27 |
mpb.PrependDecorators(
|
| 28 | 28 |
// simple name decorator
|
| 29 | 29 |
decor.Name(name),
|
| 20 | 20 |
name := fmt.Sprintf("Bar#%d:", i)
|
| 21 | 21 |
bar := p.AddBar(int64(total),
|
| 22 | 22 |
mpb.BarID(i),
|
| 23 | |
mpb.BarOptOn(mpb.BarRemoveOnComplete(), func() bool { return i == 0 }),
|
|
23 |
mpb.BarOptional(mpb.BarRemoveOnComplete(), i == 0),
|
| 24 | 24 |
mpb.PrependDecorators(
|
| 25 | 25 |
decor.Name(name),
|
| 26 | 26 |
decor.EwmaETA(decor.ET_STYLE_GO, 60, decor.WCSyncSpace),
|
| 130 | 130 |
p := mpb.New(mpb.WithOutput(ioutil.Discard))
|
| 131 | 131 |
for i := 0; i < numBars; i++ {
|
| 132 | 132 |
bar := p.AddBar(int64(total),
|
| 133 | |
mpb.BarOptOn(mpb.BarRemoveOnComplete(), func() bool { return i == 0 }),
|
|
133 |
mpb.BarOptional(mpb.BarRemoveOnComplete(), i == 0),
|
| 134 | 134 |
mpb.PrependDecorators(
|
| 135 | 135 |
decor.EwmaETA(decor.ET_STYLE_GO, 60, decor.WCSyncSpace),
|
| 136 | 136 |
),
|