use BarPriority option
Vladimir Bauer
8 years ago
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | // create bar with appropriate decorators |
| 61 | bar := p.AddBar(size, | |
| 61 | bar := p.AddBar(size, mpb.BarPriority(n), | |
| 62 | 62 | mpb.PrependDecorators( |
| 63 | decor.StaticName(name, 0, 0), | |
| 64 | decor.CountersKibiByte("%6.1f / %6.1f", 18, 0), | |
| 63 | decor.StaticName(name, len(name)+1, decor.DidentRight), | |
| 64 | decor.CountersKibiByte("%6.1f / %6.1f", 0, decor.DwidthSync), | |
| 65 | 65 | ), |
| 66 | mpb.AppendDecorators(decor.ETA(5, decor.DwidthSync)), | |
| 66 | mpb.AppendDecorators(decor.ETA(3, 0)), | |
| 67 | 67 | ) |
| 68 | // Respect the order | |
| 69 | p.UpdateBarPriority(bar, n) | |
| 70 | 68 | |
| 71 | 69 | // create proxy reader |
| 72 | 70 | reader := bar.ProxyReader(resp.Body) |