Skip to content

Commit

Permalink
mustParseBool should return false for empty string
Browse files Browse the repository at this point in the history
I.e, ENABLE_HTTPS environment variable is not set
`mustParseBool(os.Getenv("ENABLE_HTTPS"))` should be `false`
  • Loading branch information
krisis committed Jul 10, 2017
1 parent fed5e2b commit b8a841b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test-utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ func encodeResponse(response interface{}) []byte {
return bytesBuffer.Bytes()
}

// Convert string to bool and always return true if any error
// Convert string to bool and always return false if any error
func mustParseBool(str string) bool {
b, err := strconv.ParseBool(str)
if err != nil {
return true
return false
}
return b
}

0 comments on commit b8a841b

Please sign in to comment.