diff --git a/pkg/files/filesize.go b/pkg/files/filesize.go index 522497a..d3f7f2c 100644 --- a/pkg/files/filesize.go +++ b/pkg/files/filesize.go @@ -8,8 +8,8 @@ import ( var sizeSuffixes = [...]string{"B", "KiB", "MiB", "GiB", "TiB"} // convertFileSize converts size in bytes down to biggest units it represents. -// Returns converted size, unit and, a concatenation of size and unit -func convertFileSize(size int64) (float64, string, string) { +// Returns a concatenation of a converted size and a unit +func convertFileSize(size int64) string { var idx int var fSize float64 = float64(size) for idx = 0; fSize >= 1024; fSize /= 1024 { @@ -18,5 +18,5 @@ func convertFileSize(size int64) (float64, string, string) { fSizeStr := strconv.FormatFloat(fSize, 'f', 3, 64) fSizeStr = strings.TrimRight(fSizeStr, "0") fSizeStr = strings.TrimSuffix(fSizeStr, ".") - return fSize, sizeSuffixes[idx], fSizeStr + " " + sizeSuffixes[idx] + return fSizeStr + " " + sizeSuffixes[idx] }