MCPcopy Index your code
hub / github.com/devploit/nomore403 / renderLocked

Method renderLocked

cmd/progress.go:95–112  ·  view source on GitHub ↗
(completed int64)

Source from the content-addressed store, hash-verified

93}
94
95func (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}

Callers 2

doneMethod · 0.95
redrawActiveProgressFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected