(completed int64)
| 93 | } |
| 94 | |
| 95 | func (p *progress) renderLocked(completed int64) { |
| 96 | total := p.total |
| 97 | if total <= 0 { |
| 98 | return |
| 99 | } |
| 100 | |
| 101 | pct := float64(completed) / float64(total) |
| 102 | if pct > 1 { |
| 103 | pct = 1 |
| 104 | } |
| 105 | |
| 106 | filled := int(pct * float64(p.barWidth)) |
| 107 | empty := p.barWidth - filled |
| 108 | |
| 109 | bar := strings.Repeat("█", filled) + strings.Repeat("░", empty) |
| 110 | fmt.Fprintf(os.Stderr, "\r\033[2K %s %3.0f%% (%d/%d) %s", bar, pct*100, completed, total, p.technique) |
| 111 | atomic.StoreInt32(&p.active, 1) |
| 112 | } |
no outgoing calls
no test coverage detected