diff --git a/bar.go b/bar.go index ee34959..3de9e55 100644 --- a/bar.go +++ b/bar.go @@ -92,7 +92,8 @@ ) func newBar(wg *sync.WaitGroup, id int, total int64, cancel <-chan struct{}, options ...BarOption) *Bar { - if total <= 0 { + dynamic := total <= 0 + if dynamic { total = time.Now().Unix() } @@ -101,6 +102,7 @@ priority: id, total: total, etaAlpha: etaAlpha, + dynamic: dynamic, } for _, opt := range options {