Skip to content

Commit

Permalink
use ContainerOptional
Browse files Browse the repository at this point in the history
  • Loading branch information
vbauerster committed Jan 13, 2021
1 parent 6ab3f73 commit fa9a892
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions _examples/quietMode/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ func main() {
// pass &wg (optional), so p will wait for it eventually
p := mpb.New(
mpb.WithWaitGroup(&wg),
mpb.ContainerOptOn(
mpb.ContainerOptional(
// setting to nil will:
// set output to ioutil.Discard and disable internal refresh rate
// cycling, in order to not consume much CPU, hovewer a single refresh
// still will be triggered on bar complete event, per each bar.
// set output to ioutil.Discard and disable refresh rate cycle, in
// order not to consume much CPU. Hovewer a single refresh still will
// be triggered on bar complete event, per each bar.
mpb.WithOutput(nil),
func() bool { return quietMode },
quietMode,
),
)
total, numBars := 100, 3
Expand Down

0 comments on commit fa9a892

Please sign in to comment.