Revert "*Progress.Add is redundant, removing"
This reverts commit db4e8798f002127f5b1b5886d7e6e5d6e47f90b7.
Vladimir Bauer
3 years ago
| 111 | 111 | return p.New(total, SpinnerStyle(), options...) |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | // New creates a bar which renders itself by `BarFiller`, which is obtained | |
| 115 | // via provided `BarFillerBuilder`. If `total <= 0` triggering complete event | |
| 116 | // by increment methods is disabled. Panics if *Progress instance is done, | |
| 117 | // i.e. called after (*Progress).Wait(). | |
| 114 | // New creates a bar with provided BarFillerBuilder. | |
| 118 | 115 | func (p *Progress) New(total int64, builder BarFillerBuilder, options ...BarOption) *Bar { |
| 119 | filler := builder.Build() | |
| 116 | return p.Add(total, builder.Build(), options...) | |
| 117 | } | |
| 118 | ||
| 119 | // Add creates a bar which renders itself by provided filler. | |
| 120 | // If `total <= 0` triggering complete event by increment methods is disabled. | |
| 121 | // Panics if *Progress instance is done, i.e. called after (*Progress).Wait(). | |
| 122 | func (p *Progress) Add(total int64, filler BarFiller, options ...BarOption) *Bar { | |
| 120 | 123 | if filler == nil { |
| 121 | 124 | filler = NopStyle().Build() |
| 122 | 125 | } |