(count int64)
| 98 | } |
| 99 | |
| 100 | func (b *ProgressBar) formatBytes(count int64) (string, string) { |
| 101 | if count < 1000 { |
| 102 | return b.formatBytesInUnit(count, "B") |
| 103 | } |
| 104 | if count < 1000*1000 { |
| 105 | return b.formatBytesInUnit(count, "kB") |
| 106 | } |
| 107 | if count < 1000*1000*1000 { |
| 108 | return b.formatBytesInUnit(count, "MB") |
| 109 | } |
| 110 | return b.formatBytesInUnit(count, "GB") |
| 111 | } |
| 112 | |
| 113 | func (b *ProgressBar) formatBytesInUnit(count int64, unit string) (string, string) { |
| 114 | if unit == "B" { |
no test coverage detected