refactor: prependETA example
Vladimir Bauer
9 years ago
| 18 | 18 | p := mpb.New(nil).SetWidth(64) |
| 19 | 19 | // p := mpb.New(nil).RefreshRate(80 * time.Millisecond).SetWidth(64) |
| 20 | 20 | |
| 21 | name1 := "Bar#1: " | |
| 21 | name1 := "Bar#1:" | |
| 22 | 22 | bar1 := p.AddBar(50). |
| 23 | PrependName(name1, len(name1)).PrependETA(4). | |
| 24 | AppendPercentage().TrimRightSpace() | |
| 23 | PrependName(name1, 0, mpb.DwidthSync|mpb.DidentRight). | |
| 24 | PrependETA(4, mpb.DwidthSync|mpb.DextraSpace). | |
| 25 | AppendPercentage(5, 0) | |
| 25 | 26 | |
| 26 | 27 | wg.Add(1) |
| 27 | 28 | go func() { |
| 35 | 36 | }() |
| 36 | 37 | |
| 37 | 38 | bar2 := p.AddBar(100). |
| 38 | PrependName("", 0-len(name1)).PrependETA(4). | |
| 39 | AppendPercentage().TrimRightSpace() | |
| 39 | PrependName("", 0, mpb.DwidthSync). | |
| 40 | PrependETA(4, mpb.DwidthSync|mpb.DextraSpace). | |
| 41 | AppendPercentage(5, 0) | |
| 40 | 42 | |
| 41 | 43 | wg.Add(1) |
| 42 | 44 | go func() { |
| 50 | 52 | }() |
| 51 | 53 | |
| 52 | 54 | bar3 := p.AddBar(80). |
| 53 | PrependName("Bar#3: ", 0).PrependETA(4). | |
| 54 | AppendPercentage().TrimRightSpace() | |
| 55 | PrependName("Bar#3:", 0, mpb.DwidthSync|mpb.DidentRight). | |
| 56 | PrependETA(4, mpb.DwidthSync|mpb.DextraSpace). | |
| 57 | AppendPercentage(5, 0) | |
| 55 | 58 | |
| 56 | 59 | wg.Add(1) |
| 57 | 60 | go func() { |