Skip to content

Commit b8ba4a9

Browse files
committed
Consolidate size format logic.
1 parent 5896f70 commit b8ba4a9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

format/long.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,16 @@ func extractValues(node node.Node) []string {
5959
strconv.Itoa(node.LinkCount),
6060
fmt.Sprintf("%s ", node.User),
6161
fmt.Sprintf("%s ", node.Group),
62-
colorSize(node.Size, humanize.Bytes(node.Size)),
62+
formatSize(node.Size),
6363
node.Time.Month().String()[:3],
6464
fmt.Sprintf("%2d", node.Time.Day()),
6565
fmt.Sprintf("%02d:%02d", node.Time.Hour(), node.Time.Minute()),
6666
fmt.Sprintf(" %s", node.Name),
6767
}
6868
}
6969

70-
func colorSize(sizeInt int, str string) string {
70+
func formatSize(sizeInt int) string {
71+
str := humanize.Bytes(sizeInt)
7172
size := float64(sizeInt)
7273
base := float64(1024)
7374
// less than 1K

0 commit comments

Comments
 (0)