Skip to content

Commit

Permalink
Do not colorize if not necessary. (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitar authored Oct 14, 2023
1 parent f115bfa commit 6ed7439
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions console.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,10 @@ func needsQuote(s string) bool {
return false
}

// colorize returns the string s wrapped in ANSI code c, unless disabled is true.
// colorize returns the string s wrapped in ANSI code c, unless disabled is true or c is 0.
func colorize(s interface{}, c int, disabled bool) string {
e := os.Getenv("NO_COLOR")
if e != "" {
if e != "" || c == 0 {
disabled = true
}

Expand Down

0 comments on commit 6ed7439

Please sign in to comment.