Codebase list golang-github-vbauerster-mpb / db4e879
*Progress.Add is redundant, removing Vladimir Bauer 3 years ago
1 changed file(s) with 5 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
111111 return p.New(total, SpinnerStyle(), options...)
112112 }
113113
114 // New creates a bar with provided BarFillerBuilder.
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().
115118 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.
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 {
119 filler := builder.Build()
123120 if filler == nil {
124121 filler = NopStyle().Build()
125122 }