Codebase list golang-github-vbauerster-mpb / bdc6e3b
single bar example update Vladimir Bauer 8 years ago
2 changed file(s) with 10 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
4343 bar := p.AddBar(int64(total),
4444 // Prepending decorators
4545 mpb.PrependDecorators(
46 // StaticName decorator with minWidth and no extra config
47 // If you need to change name while rendering, use DynamicName
48 decor.StaticName(name, len(name), 0),
49 // ETA decorator with minWidth and no extra config
50 decor.ETA(4, 0),
46 // StaticName decorator with one extra space on right
47 decor.StaticName(name, len(name)+1, decor.DidentRight),
48 // ETA decorator with width reservation of 3 runes
49 decor.ETA(3, 0),
5150 ),
5251 // Appending decorators
5352 mpb.AppendDecorators(
54 // Percentage decorator with minWidth and no extra config
53 // Percentage decorator with width reservation of 5 runes
5554 decor.Percentage(5, 0),
5655 ),
5756 )
2424 bar := p.AddBar(int64(total),
2525 // Prepending decorators
2626 mpb.PrependDecorators(
27 // StaticName decorator with minWidth and no extra config
28 // If you need to change name while rendering, use DynamicName
29 decor.StaticName(name, len(name), 0),
30 // ETA decorator with minWidth and no extra config
31 decor.ETA(4, 0),
27 // StaticName decorator with one extra space on right
28 decor.StaticName(name, len(name)+1, decor.DidentRight),
29 // ETA decorator with width reservation of 3 runes
30 decor.ETA(3, 0),
3231 ),
3332 // Appending decorators
3433 mpb.AppendDecorators(
35 // Percentage decorator with minWidth and no extra config
34 // Percentage decorator with width reservation of 5 runes
3635 decor.Percentage(5, 0),
3736 ),
3837 )