Skip to content

Commit

Permalink
Fix handling of the IS_NO_COLOR env variable
Browse files Browse the repository at this point in the history
To make it behave as documented in the README: 

> To turn off the colors (...) with the env var IS_NO_COLOR=true.
  • Loading branch information
oliverpool committed Nov 20, 2019
1 parent 9fde238 commit 71568e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions is.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ type I struct {
var noColorFlag bool

func init() {
colorEnv := os.Getenv("IS_NO_COLOR") != "false"
flag.BoolVar(&noColorFlag, "nocolor", colorEnv, "turns off colors")
envNoColor := os.Getenv("IS_NO_COLOR") == "true"
flag.BoolVar(&noColorFlag, "nocolor", envNoColor, "turns off colors")
}

// New makes a new testing helper using the specified
Expand Down

0 comments on commit 71568e0

Please sign in to comment.