example update
Vladimir Bauer
9 years ago
| 15 | 15 | func main() { |
| 16 | 16 | |
| 17 | 17 | var wg sync.WaitGroup |
| 18 | p := mpb.New().WithSort(mpb.SortTop).SetWidth(60) | |
| 18 | p := mpb.New().SetWidth(60).WithSort(mpb.SortTop) | |
| 19 | 19 | |
| 20 | name1 := "Bar#1:" | |
| 21 | bar1 := p.AddBar(100).AppendETA().PrependFunc(getDecor()).PrependName(name1, len(name1)) | |
| 20 | name1 := "Bar#1: " | |
| 21 | bar1 := p.AddBar(100). | |
| 22 | PrependName(name1, len(name1)).PrependFunc(getDecor()). | |
| 23 | AppendETA() | |
| 22 | 24 | wg.Add(1) |
| 23 | 25 | go func() { |
| 24 | 26 | defer wg.Done() |
| 30 | 32 | } |
| 31 | 33 | }() |
| 32 | 34 | |
| 33 | bar2 := p.AddBar(60).AppendETA().PrependFunc(getDecor()).PrependName("", 0-len(name1)) | |
| 35 | bar2 := p.AddBar(60). | |
| 36 | PrependName("", 0-len(name1)).PrependFunc(getDecor()). | |
| 37 | AppendETA() | |
| 34 | 38 | wg.Add(1) |
| 35 | 39 | go func() { |
| 36 | 40 | defer wg.Done() |
| 42 | 46 | } |
| 43 | 47 | }() |
| 44 | 48 | |
| 45 | bar3 := p.AddBar(80).AppendETA().PrependFunc(getDecor()).PrependName("Bar#3:", 0) | |
| 49 | bar3 := p.AddBar(80). | |
| 50 | PrependName("Bar#3: ", 0).PrependFunc(getDecor()). | |
| 51 | AppendETA() | |
| 46 | 52 | wg.Add(1) |
| 47 | 53 | go func() { |
| 48 | 54 | defer wg.Done() |