Codebase list golang-github-vbauerster-mpb / 6e1da6e
don't let set negative current Vladimir Bauer 3 years ago
1 changed file(s) with 3 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
219219 }
220220
221221 // SetCurrent sets progress' current to an arbitrary value.
222 // Setting a negative value will cause a panic.
223222 func (b *Bar) SetCurrent(current int64) {
223 if current < 0 {
224 return
225 }
224226 select {
225227 case b.operateState <- func(s *bState) {
226228 s.current = current