Codebase list golang-github-vbauerster-mpb / 9d79c91
package example update Vladimir Bauer 9 years ago
1 changed file(s) with 4 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
2121 p.RefreshRate(120 * time.Millisecond)
2222
2323 // Add a bar. You're not limited to just one bar, add many if you need.
24 bar := p.AddBar(100).PrependName("Single Bar:", 0).AppendPercentage()
24 bar := p.AddBar(100).
25 PrependName("Single Bar:", 0, mpb.DwidthSync).
26 AppendPercentage(5, 0)
2527
2628 for i := 0; i < 100; i++ {
2729 bar.Incr(1) // increment progress bar
3739
3840 func ExampleBar_InProgress() {
3941 p := mpb.New(nil)
40 bar := p.AddBar(100).AppendPercentage()
42 bar := p.AddBar(100).AppendPercentage(5, 0)
4143
4244 for bar.InProgress() {
4345 bar.Incr(1)