Codebase list golang-github-vbauerster-mpb / 9df2f8e
Revert "*Progress.Add is redundant, removing" This reverts commit db4e8798f002127f5b1b5886d7e6e5d6e47f90b7. Vladimir Bauer 3 years ago
1 changed file(s) with 8 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
111111 return p.New(total, SpinnerStyle(), options...)
112112 }
113113
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.
118115 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 {
120123 if filler == nil {
121124 filler = NopStyle().Build()
122125 }