cosmetics...
Vladimir Bauer
4 years ago
| 106 | 106 | |
| 107 | 107 | // Add creates a bar which renders itself by provided filler. |
| 108 | 108 | // If `total <= 0` triggering complete event by increment methods is disabled. |
| 109 | // Panics if (*Progress) instance is done, i.e. called after (*Progress).Wait(). | |
| 109 | // Panics if *Progress instance is done, i.e. called after (*Progress).Wait(). | |
| 110 | 110 | func (p *Progress) Add(total int64, filler BarFiller, options ...BarOption) *Bar { |
| 111 | 111 | if filler == nil { |
| 112 | 112 | filler = NopStyle().Build() |
| 180 | 180 | // After this method has been called, there is no way to reuse *Progress |
| 181 | 181 | // instance. |
| 182 | 182 | func (p *Progress) Wait() { |
| 183 | // wait for user wg, if any | |
| 183 | 184 | if p.uwg != nil { |
| 184 | // wait for user wg | |
| 185 | 185 | p.uwg.Wait() |
| 186 | 186 | } |
| 187 | 187 | |