Codebase list golang-github-vbauerster-mpb / 793ee10
minor: param rename Vladimir Bauer 3 years ago
1 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
198198 // SetTotal sets total to an arbitrary value. It's effective only for
199199 // bar which was constructed with `total <= 0`. Setting total to negative
200200 // value is equivalent to (*Bar).SetTotal((*Bar).Current(), bool) but faster.
201 // If triggerCompleteNow is true, total value is set to current and
201 // If triggerCompletion is true, total value is set to current and
202202 // complete event is triggered right away.
203 func (b *Bar) SetTotal(total int64, triggerCompleteNow bool) {
203 func (b *Bar) SetTotal(total int64, triggerCompletion bool) {
204204 select {
205205 case b.operateState <- func(s *bState) {
206206 if s.triggerComplete {
211211 } else {
212212 s.total = total
213213 }
214 if triggerCompleteNow {
214 if triggerCompletion {
215215 s.current = s.total
216216 s.completed = true
217217 b.triggerCompletion(s)