Skip to content

Commit

Permalink
fix(iostreams): If enabled, proxy the color to ansi.ColorFunc (#1603)
Browse files Browse the repository at this point in the history
Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
Approved-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
  • Loading branch information
craciunoiuc committed Apr 29, 2024
2 parents 3b6315f + d2e61f6 commit 161334c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions iostreams/color.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,12 @@ func (c *ColorScheme) ColorFromString(s string) func(string) string {
case "blue":
fn = c.Blue
default:
fn = func(s string) string {
return s
if c.enabled {
fn = ansi.ColorFunc(s)
} else {
fn = func(s string) string {
return s
}
}
}

Expand Down

0 comments on commit 161334c

Please sign in to comment.