minor: refactoring cancel example
Vladimir Bauer
3 years ago
| 22 | 22 | wg.Add(numBars) |
| 23 | 23 | |
| 24 | 24 | for i := 0; i < numBars; i++ { |
| 25 | name := fmt.Sprintf("Bar#%d:", i) | |
| 25 | name := fmt.Sprintf("Bar#%02d: ", i) | |
| 26 | 26 | bar := p.AddBar(int64(total), |
| 27 | 27 | mpb.PrependDecorators( |
| 28 | decor.Name(name), | |
| 29 | decor.EwmaETA(decor.ET_STYLE_GO, 60, decor.WCSyncSpace), | |
| 28 | decor.Name(name, decor.WCSyncWidthR), | |
| 29 | decor.EwmaETA(decor.ET_STYLE_GO, 60, decor.WCSyncWidth), | |
| 30 | 30 | ), |
| 31 | 31 | mpb.AppendDecorators( |
| 32 | 32 | // note that OnComplete will not be fired, because of cancel |