simple example: show sync width
Vladimir Bauer
9 years ago
| 75 | 75 | name := fmt.Sprintf("Bar#%d:", i) |
| 76 | 76 | bar := p.AddBar(100). |
| 77 | 77 | PrependName(name, len(name), 0). |
| 78 | AppendPercentage(5, 0) | |
| 78 | // Prepend Percentage decorator and sync width | |
| 79 | PrependPercentage(3, mpb.DwidthSync|mpb.DextraSpace). | |
| 80 | // Append ETA and don't sync width | |
| 81 | AppendETA(2, 0) | |
| 79 | 82 | go func() { |
| 80 | 83 | defer wg.Done() |
| 81 | 84 | // you can p.AddBar() here, but ordering will be non deterministic |
Binary diff not shown
| 16 | 16 | name := fmt.Sprintf("Bar#%d:", i) |
| 17 | 17 | bar := p.AddBar(100). |
| 18 | 18 | PrependName(name, len(name), 0). |
| 19 | AppendPercentage(5, 0) | |
| 19 | // Prepend Percentage decorator and sync width | |
| 20 | PrependPercentage(3, mpb.DwidthSync|mpb.DextraSpace). | |
| 21 | // Append ETA and don't sync width | |
| 22 | AppendETA(2, 0) | |
| 20 | 23 | go func() { |
| 21 | 24 | defer wg.Done() |
| 22 | 25 | // you can p.AddBar() here, but ordering will be non deterministic |