Skip to content

Commit ab171a9

Browse files
committed
Scope colorize func to formatMode func.
1 parent e6ef6f5 commit ab171a9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

format/long.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ func formatTime(node node.Node) string {
114114
func formatMode(mode string) string {
115115
runes := []rune(mode)
116116

117+
colorize := func(mode rune, color *color.Color) string {
118+
if mode == '-' { return "-" }
119+
return color.Sprintf("%c", mode)
120+
}
121+
117122
return fmt.Sprintf(
118123
"%s%s%s%s%s%s%s%s%s%s ",
119124
colorize(runes[0], color.New(color.FgWhite, color.Bold)),
@@ -129,11 +134,6 @@ func formatMode(mode string) string {
129134
)
130135
}
131136

132-
func colorize(mode rune, color *color.Color) string {
133-
if mode == '-' { return "-" }
134-
return color.Sprintf("%c", mode)
135-
}
136-
137137
func formatName(node node.Node) string {
138138
baseColor := nodeColor(node)
139139

0 commit comments

Comments
 (0)