Codebase list golang-github-vbauerster-mpb / c51c704
SetTotal godoc upd Vladimir Bauer 4 years ago
1 changed file(s) with 4 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
179179 }
180180
181181 // SetTotal sets total to an arbitrary value. It's effective only for
182 // bar which was constructed with `total <= 0` and if
183 // (*Bar).EnableTriggerComplete hasn't been called yet. Setting total
184 // to negative value is equivalent to (*Bar).SetTotal((*Bar).Current(),
185 // bool). If triggerCompleteNow is true then total value is set to
186 // current and complete event is triggered right away.
182 // bar which was constructed with `total <= 0`. Setting total to negative
183 // value is equivalent to (*Bar).SetTotal((*Bar).Current(), bool).
184 // If triggerCompleteNow is true, total value is set to current and
185 // complete event is triggered right away.
187186 func (b *Bar) SetTotal(total int64, triggerCompleteNow bool) {
188187 select {
189188 case b.operateState <- func(s *bState) {