done increments the completed counter and redraws the progress bar.
()
| 66 | |
| 67 | // done increments the completed counter and redraws the progress bar. |
| 68 | func (p *progress) done() { |
| 69 | if p.total <= 0 || !progressEnabled() { |
| 70 | return |
| 71 | } |
| 72 | c := atomic.AddInt64(&p.completed, 1) |
| 73 | |
| 74 | printMutex.Lock() |
| 75 | defer printMutex.Unlock() |
| 76 | p.renderLocked(c) |
| 77 | } |
| 78 | |
| 79 | // finish clears the progress bar for good. |
| 80 | func (p *progress) finish() { |
no test coverage detected