diff --git a/bar.go b/bar.go index fae5319..fcd7efd 100644 --- a/bar.go +++ b/bar.go @@ -220,8 +220,10 @@ } // SetCurrent sets progress' current to an arbitrary value. -// Setting a negative value will cause a panic. func (b *Bar) SetCurrent(current int64) { + if current < 0 { + return + } select { case b.operateState <- func(s *bState) { s.current = current