From c3731c4eff12cc9e6636f89128948d86596ad860 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 8 Mar 2026 17:53:22 +0800 Subject: internal/progress: Use range here --- internal/progress/humanize.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/progress') 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]) -- cgit v1.3.1-10-gc9f91