newProgress creates a new progress tracker. Pass 0 total to disable.
(technique string, total int)
| 51 | |
| 52 | // newProgress creates a new progress tracker. Pass 0 total to disable. |
| 53 | func newProgress(technique string, total int) *progress { |
| 54 | p := &progress{ |
| 55 | total: int64(total), |
| 56 | technique: technique, |
| 57 | barWidth: 25, |
| 58 | } |
| 59 | if total > 0 && progressEnabled() { |
| 60 | printMutex.Lock() |
| 61 | activeProgress = p |
| 62 | printMutex.Unlock() |
| 63 | } |
| 64 | return p |
| 65 | } |
| 66 | |
| 67 | // done increments the completed counter and redraws the progress bar. |
| 68 | func (p *progress) done() { |
no outgoing calls
no test coverage detected