rename method Add to AddFiller
Vladimir Bauer
3 years ago
| 113 | 113 | |
| 114 | 114 | // New creates a bar with provided BarFillerBuilder. |
| 115 | 115 | func (p *Progress) New(total int64, builder BarFillerBuilder, options ...BarOption) *Bar { |
| 116 | return p.Add(total, builder.Build(), options...) | |
| 117 | } | |
| 118 | ||
| 119 | // Add creates a bar which renders itself by provided filler. | |
| 116 | return p.AddFiller(total, builder.Build(), options...) | |
| 117 | } | |
| 118 | ||
| 119 | // AddFiller creates a bar which renders itself by provided filler. | |
| 120 | 120 | // If `total <= 0` triggering complete event by increment methods is disabled. |
| 121 | 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 { | |
| 122 | func (p *Progress) AddFiller(total int64, filler BarFiller, options ...BarOption) *Bar { | |
| 123 | 123 | if filler == nil { |
| 124 | 124 | filler = NopStyle().Build() |
| 125 | 125 | } |