Add a space between size and unit.
This commit is contained in:
parent
8e44aa1477
commit
0c05ffeef6
@ -1,7 +1,6 @@
|
|||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
@ -26,7 +25,7 @@ func ConvertFileSize(size int64) (float64, string, string) {
|
|||||||
fSizeStr = strings.TrimRight(fSizeStr, "0")
|
fSizeStr = strings.TrimRight(fSizeStr, "0")
|
||||||
fSizeStr = strings.TrimSuffix(fSizeStr, ".")
|
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) {
|
func DirectorySize(path string) (dirSz int64, err error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user