diff --git a/_examples/differentWidth/main.go b/_examples/differentWidth/main.go index 4375a0b..7ed5b42 100644 --- a/_examples/differentWidth/main.go +++ b/_examples/differentWidth/main.go @@ -24,7 +24,7 @@ name := fmt.Sprintf("Bar#%d:", i) bar := p.AddBar(int64(total), // set BarWidth 40 for bar 1 and 2 - mpb.BarOptOn(mpb.BarWidth(40), func() bool { return i > 0 }), + mpb.BarOptional(mpb.BarWidth(40), i > 0), mpb.PrependDecorators( // simple name decorator decor.Name(name), diff --git a/_examples/remove/main.go b/_examples/remove/main.go index 2c5687a..ab8d90d 100644 --- a/_examples/remove/main.go +++ b/_examples/remove/main.go @@ -21,7 +21,7 @@ name := fmt.Sprintf("Bar#%d:", i) bar := p.AddBar(int64(total), mpb.BarID(i), - mpb.BarOptOn(mpb.BarRemoveOnComplete(), func() bool { return i == 0 }), + mpb.BarOptional(mpb.BarRemoveOnComplete(), i == 0), mpb.PrependDecorators( decor.Name(name), decor.EwmaETA(decor.ET_STYLE_GO, 60, decor.WCSyncSpace), diff --git a/progress_test.go b/progress_test.go index b14c723..aa7a27d 100644 --- a/progress_test.go +++ b/progress_test.go @@ -131,7 +131,7 @@ p := mpb.New(mpb.WithOutput(ioutil.Discard)) for i := 0; i < numBars; i++ { bar := p.AddBar(int64(total), - mpb.BarOptOn(mpb.BarRemoveOnComplete(), func() bool { return i == 0 }), + mpb.BarOptional(mpb.BarRemoveOnComplete(), i == 0), mpb.PrependDecorators( decor.EwmaETA(decor.ET_STYLE_GO, 60, decor.WCSyncSpace), ),