Codebase list golang-github-vbauerster-mpb / 9c136f9
refactor examples Vladimir Bauer 7 years ago
3 changed file(s) with 7 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
3838
3939 p := mpb.New(
4040 mpb.WithWidth(60),
41 mpb.WithFormat("[=>-|"),
4241 mpb.WithRefreshRate(180*time.Millisecond),
4342 )
4443
45 bar := p.AddBar(size,
44 bar := p.AddBar(size, mpb.BarStyle("[=>-|"),
4645 mpb.PrependDecorators(
4746 decor.CountersKibiByte("% 6.1f / % 6.1f"),
4847 ),
1111 p := mpb.New(
1212 // override default (80) width
1313 mpb.WithWidth(64),
14 // override default "[=>-]" format
15 mpb.WithFormat("╢▌▌░╟"),
1614 // override default 120ms refresh rate
1715 mpb.WithRefreshRate(180*time.Millisecond),
1816 )
2119 name := "Single Bar:"
2220 // adding a single bar
2321 bar := p.AddBar(int64(total),
22 // override default "[=>-]" style
23 mpb.BarStyle("╢▌▌░╟"),
2424 mpb.PrependDecorators(
2525 // display our name with one space on the right
2626 decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}),
1919
2020 func main() {
2121 var wg sync.WaitGroup
22 p := mpb.New(mpb.WithWaitGroup(&wg))
22 p := mpb.New(
23 mpb.WithWaitGroup(&wg),
24 mpb.WithRefreshRate(50*time.Millisecond),
25 )
2326 wg.Add(totalBars)
2427
2528 for i := 0; i < totalBars; i++ {