Codebase list golang-github-vbauerster-mpb / 91909da
examples update Vladimir Bauer 6 years ago
4 changed file(s) with 3 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
3636 name := "Single Bar:"
3737 // adding a single bar, which will inherit container's width
3838 bar := p.AddBar(int64(total),
39 // set custom bar style, default one is "[=>-]"
39 // override mpb.DefaultBarStyle, which is "[=>-]<+"
4040 mpb.BarStyle("╢▌▌░╟"),
4141 mpb.PrependDecorators(
4242 // display our name with one space on the right
2121 bar := p.AddBar(int64(total),
2222 // reverse Bar#1
2323 mpb.BarOptOnCond(mpb.BarReverse(), func() bool { return i == 1 }),
24 mpb.BarNoBrackets(),
2524 mpb.PrependDecorators(
2625 // simple name decorator
2726 decor.Name(name),
1515 name := "Single Bar:"
1616 // adding a single bar, which will inherit container's width
1717 bar := p.AddBar(int64(total),
18 // set custom bar style, default one is "[=>-]"
18 // override mpb.DefaultBarStyle, which is "[=>-]<+"
1919 mpb.BarStyle("╢▌▌░╟"),
2020 mpb.PrependDecorators(
2121 // display our name with one space on the right
5353 type refiller interface {
5454 SetRefill(int64)
5555 }
56 filler := mpb.NewBarFiller()
56 filler := mpb.NewBarFiller(mpb.DefaultBarStyle, false)
5757 nextCh := make(chan struct{}, 1)
5858 var msg *string
5959 return func(w io.Writer, width int, st *decor.Statistics) {