finish clears the progress bar for good.
()
| 78 | |
| 79 | // finish clears the progress bar for good. |
| 80 | func (p *progress) finish() { |
| 81 | if p.total <= 0 || !progressEnabled() { |
| 82 | return |
| 83 | } |
| 84 | printMutex.Lock() |
| 85 | defer printMutex.Unlock() |
| 86 | if atomic.LoadInt32(&p.active) == 1 { |
| 87 | fmt.Fprintf(os.Stderr, "\r\033[2K") |
| 88 | atomic.StoreInt32(&p.active, 0) |
| 89 | } |
| 90 | if activeProgress == p { |
| 91 | activeProgress = nil |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | func (p *progress) renderLocked(completed int64) { |
| 96 | total := p.total |
no outgoing calls
no test coverage detected