readme: v7 api
Vladimir Bauer
5 years ago
| 25 | 25 | "math/rand" |
| 26 | 26 | "time" |
| 27 | 27 | |
| 28 | "github.com/vbauerster/mpb/v6" | |
| 29 | "github.com/vbauerster/mpb/v6/decor" | |
| 28 | "github.com/vbauerster/mpb/v7" | |
| 29 | "github.com/vbauerster/mpb/v7/decor" | |
| 30 | 30 | ) |
| 31 | 31 | |
| 32 | 32 | func main() { |
| 38 | 38 | // adding a single bar, which will inherit container's width |
| 39 | 39 | bar := p.Add(int64(total), |
| 40 | 40 | // progress bar filler with customized style |
| 41 | mpb.NewBarFiller("╢▌▌░╟"), | |
| 41 | mpb.NewBarFiller(mpb.BarStyle().Lbound("╢").Filler("▌").Tip("▌").Padding("░").Rbound("╟")), | |
| 42 | 42 | mpb.PrependDecorators( |
| 43 | 43 | // display our name with one space on the right |
| 44 | 44 | decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}), |