dynamic is true, if total unknown
Vladimir Bauer
8 years ago
| 91 | 91 | ) |
| 92 | 92 | |
| 93 | 93 | func newBar(wg *sync.WaitGroup, id int, total int64, cancel <-chan struct{}, options ...BarOption) *Bar { |
| 94 | if total <= 0 { | |
| 94 | dynamic := total <= 0 | |
| 95 | if dynamic { | |
| 95 | 96 | total = time.Now().Unix() |
| 96 | 97 | } |
| 97 | 98 | |
| 100 | 101 | priority: id, |
| 101 | 102 | total: total, |
| 102 | 103 | etaAlpha: etaAlpha, |
| 104 | dynamic: dynamic, | |
| 103 | 105 | } |
| 104 | 106 | |
| 105 | 107 | for _, opt := range options { |