diff --git a/example_test.go b/example_test.go index 0dc96ad..f591000 100644 --- a/example_test.go +++ b/example_test.go @@ -23,7 +23,7 @@ total := 100 name := "Single Bar:" - startBlock := make(chan time.Time) + sbEta := make(chan time.Time) // adding a single bar bar := p.AddBar(int64(total), mpb.PrependDecorators( @@ -32,7 +32,7 @@ // replace ETA decorator with "done" message, OnComplete event decor.OnComplete( // ETA decorator with default eta age, and width reservation of 4 - decor.ETA(decor.ET_STYLE_GO, 0, startBlock, decor.WC{W: 4}), "done", + decor.ETA(decor.ET_STYLE_GO, 0, sbEta, decor.WC{W: 4}), "done", ), ), mpb.AppendDecorators(decor.Percentage()), @@ -42,7 +42,7 @@ max := 100 * time.Millisecond for i := 0; i < total; i++ { // update start block time, required for ETA calculation - startBlock <- time.Now() + sbEta <- time.Now() time.Sleep(time.Duration(rand.Intn(10)+1) * max / 10) // increment by 1 (there is bar.IncrBy(int) method, if needed) bar.Increment()