diff options
| author | 2026-03-08 17:53:22 +0800 | |
|---|---|---|
| committer | 2026-03-08 17:53:22 +0800 | |
| commit | c3731c4eff12cc9e6636f89128948d86596ad860 (patch) | |
| tree | 4acfb35939ab95b41688ea4ad4d2335a689668d6 /internal | |
| parent | README: Structured features (diff) | |
| signature | No signature | |
internal/progress: Use range here
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/progress/humanize.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/progress/humanize.go b/internal/progress/humanize.go index 8363d6b1..fd68e1e9 100644 --- a/internal/progress/humanize.go +++ b/internal/progress/humanize.go @@ -10,7 +10,7 @@ func humanizeBytes(n uint64) string { value := float64(n) units := []string{"KiB", "MiB", "GiB", "TiB", "PiB"} - for i := 0; i < len(units); i++ { + for i := range units { value /= unit if value < unit || i == len(units)-1 { return fmt.Sprintf("%.2f %s", value, units[i]) |
