(current int64)
| 20 | } |
| 21 | |
| 22 | func (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 | } |
nothing calls this directly
no test coverage detected