Skip to content

Commit 558311f

Browse files
committed
Swap node color() to return *color.Color.
1 parent 081e3c2 commit 558311f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

node/root.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func Fetch() []Node {
3333
}
3434

3535
func (n node) Name() string {
36-
return n.color()(n.name())
36+
return n.color().SprintFunc()(n.name())
3737
}
3838

3939
func (n node) name() string {
@@ -47,9 +47,9 @@ func (n node) icon() rune {
4747
return ' '
4848
}
4949

50-
func (n node) color() func(a ...interface{}) string {
51-
if n.file.IsDir() { return color.New(color.FgCyan, color.Bold).SprintFunc() }
52-
return color.New(color.FgWhite).SprintFunc()
50+
func (n node) color() *color.Color {
51+
if n.file.IsDir() { return color.New(color.FgCyan, color.Bold) }
52+
return color.New(color.FgWhite)
5353
}
5454

5555
func (n node) Size() int {

0 commit comments

Comments
 (0)