Codebase list golang-github-vbauerster-mpb / 71f2ebe
correct mexicanBar example Vladimir Bauer 2 years ago
1 changed file(s) with 6 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
1515 total := 100
1616 name := "Complex Filler:"
1717 bs := mpb.BarStyle()
18 bs.LboundMeta(func(s string) string {
18 bs = bs.LboundMeta(func(s string) string {
1919 return fmt.Sprint("\033[34m", s, "\033[0m") // blue
2020 })
21 bs.Filler("_").FillerMeta(func(s string) string {
21 bs = bs.Filler("_").FillerMeta(func(s string) string {
2222 return fmt.Sprint("\033[36m", s, "\033[0m") // cyan
2323 })
24 bs.Tip("⛵").TipMeta(func(s string) string {
24 bs = bs.Tip("⛵").TipMeta(func(s string) string {
2525 return fmt.Sprint("\033[31m", s, "\033[0m") // red
2626 })
27 bs.TipOnComplete() // leave tip on complete
28 bs.Padding("_").PaddingMeta(func(s string) string {
27 bs = bs.TipOnComplete() // leave tip on complete
28 bs = bs.Padding("_").PaddingMeta(func(s string) string {
2929 return fmt.Sprint("\033[36m", s, "\033[0m") // cyan
3030 })
31 bs.RboundMeta(func(s string) string {
31 bs = bs.RboundMeta(func(s string) string {
3232 return fmt.Sprint("\033[34m", s, "\033[0m") // blue
3333 })
3434 bar := p.New(int64(total), bs,