initialize shutdownNotifier early
Vladimir Bauer
3 years ago
| 88 | 88 | if opt != nil { |
| 89 | 89 | opt(s) |
| 90 | 90 | } |
| 91 | } | |
| 92 | ||
| 93 | if s.shutdownNotifier == nil { | |
| 94 | s.shutdownNotifier = make(chan struct{}) | |
| 91 | 95 | } |
| 92 | 96 | |
| 93 | 97 | p := &Progress{ |
| 372 | 376 | |
| 373 | 377 | func (s *pState) newTicker(done <-chan struct{}) chan time.Time { |
| 374 | 378 | ch := make(chan time.Time) |
| 375 | if s.shutdownNotifier == nil { | |
| 376 | s.shutdownNotifier = make(chan struct{}) | |
| 377 | } | |
| 378 | 379 | go func() { |
| 379 | 380 | var autoRefresh <-chan time.Time |
| 380 | 381 | if !s.disableAutoRefresh { |