We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9db1861 commit c912221Copy full SHA for c912221
src/util/env.go
@@ -21,7 +21,12 @@ func isTruthyEnvValue(value string) bool {
21
}
22
23
for i := 0; i < valueLen; i++ {
24
- if value[i] != '0' {
+ if value[i] != '0' &&
25
+ value[i] != ' ' &&
26
+ value[i] != '\t' &&
27
+ value[i] != '\f' &&
28
+ value[i] != '\r' &&
29
+ value[i] != '\n' {
30
return true
31
32
src/util/env_test.go
@@ -39,4 +39,12 @@ func TestIsTruthyEnvValue(t *testing.T) {
39
if !expect("0000", false) {
40
t.Error()
41
42
+
43
+ if !expect(" ", false) {
44
+ t.Error()
45
+ }
46
47
+ if !expect(" 0", false) {
48
49
50
0 commit comments