SetTotal is only effective for "never complete" bar
Vladimir Bauer
4 years ago
| 183 | 183 |
func (b *Bar) SetTotal(total int64, triggerCompleteNow bool) {
|
| 184 | 184 |
select {
|
| 185 | 185 |
case b.operateState <- func(s *bState) {
|
|
186 |
if s.triggerComplete {
|
|
187 |
return
|
|
188 |
}
|
| 186 | 189 |
if total < 0 {
|
| 187 | 190 |
s.total = s.current
|
| 188 | 191 |
} else {
|