diff --git a/example/io/multiple/main.go b/example/io/multiple/main.go index d50d2a0..4ca6386 100644 --- a/example/io/multiple/main.go +++ b/example/io/multiple/main.go @@ -61,7 +61,7 @@ // create bar with appropriate decorators bar := p.AddBar(size). PrependName(name, 0, 0). - PrependCounters(mpb.UnitBytes, 18, mpb.DwidthSync|mpb.DextraSpace). + PrependCounters("%3s / %3s", mpb.UnitBytes, 18, mpb.DwidthSync|mpb.DextraSpace). AppendETA(5, mpb.DwidthSync) // create proxy reader diff --git a/example/io/single/main.go b/example/io/single/main.go index c79e787..617bb9a 100644 --- a/example/io/single/main.go +++ b/example/io/single/main.go @@ -38,7 +38,7 @@ p := mpb.New(nil).SetWidth(64) bar := p.AddBar(size). - PrependCounters(mpb.UnitBytes, 18, 0). + PrependCounters("%3s / %3s", mpb.UnitBytes, 18, 0). AppendETA(3, 0) // create proxy reader diff --git a/example/simple/main.go b/example/simple/main.go index 6b564ad..4a8b5ad 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,10 +12,12 @@ func main() { var wg sync.WaitGroup p := mpb.New(nil) + wg.Add(3) // add wg delta for i := 0; i < 3; i++ { - wg.Add(1) // add wg delta name := fmt.Sprintf("Bar#%d:", i) - bar := p.AddBar(100).PrependName(name, len(name)).AppendPercentage() + bar := p.AddBar(100). + PrependName(name, len(name), 0). + AppendPercentage(5, 0) go func() { defer wg.Done() // you can p.AddBar() here, but ordering will be non deterministic diff --git a/example_test.go b/example_test.go index 900e544..cdedaab 100644 --- a/example_test.go +++ b/example_test.go @@ -23,7 +23,7 @@ // Add a bar. You're not limited to just one bar, add many if you need. bar := p.AddBar(100). - PrependName("Single Bar:", 0, mpb.DwidthSync). + PrependName("Single Bar:", 0, 0). AppendPercentage(5, 0) for i := 0; i < 100; i++ {