example_test update 2
Vladimir Bauer
9 years ago
| 36 | 36 |
// Star mpb's rendering goroutine.
|
| 37 | 37 |
p := mpb.New()
|
| 38 | 38 |
// Set custom width for every bar, which mpb will render
|
| 39 | |
// The default one in 70
|
| 40 | |
p.SetWidth(80)
|
|
39 |
// The default one in 80
|
|
40 |
p.SetWidth(100)
|
| 41 | 41 |
// Set custom format for every bar, the default one is "[=>-]"
|
| 42 | 42 |
p.Format("╢▌▌░╟")
|
| 43 | 43 |
// Set custom refresh rate, the default one is 100 ms
|
| 11 | 11 |
|
| 12 | 12 |
func Example() {
|
| 13 | 13 |
// Star mpb's rendering goroutine.
|
| 14 | |
// If you don't plan to cancel, feed with nil
|
| 15 | |
// otherwise provide context.Context, see cancel example
|
| 16 | 14 |
p := mpb.New()
|
| 17 | 15 |
// Set custom width for every bar, which mpb will contain
|
| 18 | |
// The default one in 70
|
| 19 | |
p.SetWidth(80)
|
|
16 |
// The default one in 80
|
|
17 |
p.SetWidth(100)
|
| 20 | 18 |
// Set custom format for every bar, the default one is "[=>-]"
|
| 21 | 19 |
p.Format("╢▌▌░╟")
|
| 22 | 20 |
// Set custom refresh rate, the default one is 100 ms
|