1
0

Add a space between size and unit.

This commit is contained in:
Alexander Andreev 2022-02-08 01:52:27 +04:00
parent 8e44aa1477
commit 0c05ffeef6
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -1,7 +1,6 @@
package utils
import (
"fmt"
"io/fs"
"path/filepath"
"strconv"
@ -26,7 +25,7 @@ func ConvertFileSize(size int64) (float64, string, string) {
fSizeStr = strings.TrimRight(fSizeStr, "0")
fSizeStr = strings.TrimSuffix(fSizeStr, ".")
return fSize, sizeSuffixes[idx], fmt.Sprint(fSizeStr, sizeSuffixes[idx])
return fSize, sizeSuffixes[idx], strings.Join([]string{fSizeStr, sizeSuffixes[idx]}, " ")
}
func DirectorySize(path string) (dirSz int64, err error) {