shithub: furgit

Download patch

ref: c3731c4eff12cc9e6636f89128948d86596ad860
parent: 23a19abfa4e6fdc10aff7e22a67945e08a3d73c4
author: Runxi Yu <me@runxiyu.org>
date: Sun Mar 8 13:53:22 EDT 2026

internal/progress: Use range here

--- a/internal/progress/humanize.go
+++ b/internal/progress/humanize.go
@@ -10,7 +10,7 @@
 
 	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])
--