diff options
| author | 2026-04-02 06:23:30 +0000 | |
|---|---|---|
| committer | 2026-04-02 06:28:39 +0000 | |
| commit | a041d523de389b65b98a5373a8034041db2a8d83 (patch) | |
| tree | 7b423dc735f463be616045f2c3c2095a7737aca7 /internal/progress/humanize.go | |
| parent | research: Add dynamic pack resources (diff) | |
| signature | No signature | |
*: Remove
Diffstat (limited to 'internal/progress/humanize.go')
| -rw-r--r-- | internal/progress/humanize.go | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/internal/progress/humanize.go b/internal/progress/humanize.go deleted file mode 100644 index f13845f7..00000000 --- a/internal/progress/humanize.go +++ /dev/null @@ -1,22 +0,0 @@ -package progress - -import "fmt" - -func humanizeBytes(n uint64) string { - const unit = 1024 - if n < unit { - return fmt.Sprintf("%d B", n) - } - - value := float64(n) - - units := []string{"KiB", "MiB", "GiB", "TiB", "PiB"} - for i := range units { - value /= unit - if value < unit || i == len(units)-1 { - return fmt.Sprintf("%.2f %s", value, units[i]) - } - } - - return fmt.Sprintf("%d B", n) -} |
