diff --git a/bar.go b/bar.go index 6c30292..88f80b3 100644 --- a/bar.go +++ b/bar.go @@ -132,8 +132,11 @@ // Given default bar style is "[=>-]<+", refill rune is '+'. // To set bar style use mpb.BarStyle(string) BarOption. func (b *Bar) SetRefill(amount int64) { - b.operateState <- func(s *bState) { + select { + case b.operateState <- func(s *bState) { s.refill = amount + }: + case <-b.done: } }