Codebase list golang-github-vbauerster-mpb / 9146efc
godoc comments Vladimir Bauer 4 years ago
2 changed file(s) with 5 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
177177 }
178178
179179 // SetTotal sets total to an arbitrary value. Setting it to negative
180 // value is equivalent to (*Bar).SetTotal((*Bar).Current(), bool).
180 // value is equivalent to (*Bar).SetTotal((*Bar).Current(), bool). If
181 // triggerCompleteNow is true, current value is set to total and
182 // complete event is triggered right away.
181183 func (b *Bar) SetTotal(total int64, triggerCompleteNow bool) {
182184 select {
183185 case b.operateState <- func(s *bState) {
105105 }
106106
107107 // Add creates a bar which renders itself by provided filler.
108 // If `total <= 0` trigger complete event is disabled until reset with (*bar).SetTotal(int64, bool).
109 // Panics if *Progress instance is done, i.e. called after (*Progress).Wait.
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().
110110 func (p *Progress) Add(total int64, filler BarFiller, options ...BarOption) *Bar {
111111 if filler == nil {
112112 filler = NopStyle().Build()