MCPcopy Create free account
hub / github.com/github/gh-aw / Update

Method Update

pkg/console/progress_wasm.go:22–36  ·  view source on GitHub ↗
(current int64)

Source from the content-addressed store, hash-verified

20}
21
22func (p *ProgressBar) Update(current int64) string {
23 p.current = current
24 p.updateCount++
25 if p.indeterminate {
26 if current == 0 {
27 return "Processing..."
28 }
29 return fmt.Sprintf("Processing... (%s)", formatBytes(current))
30 }
31 if p.total == 0 {
32 return "100% (0B/0B)"
33 }
34 percent := float64(current) / float64(p.total)
35 return fmt.Sprintf("%d%% (%s/%s)", int(percent*100), formatBytes(current), formatBytes(p.total))
36}

Callers

nothing calls this directly

Calls 1

formatBytesFunction · 0.85

Tested by

no test coverage detected