summaryrefslogtreecommitdiff
path: root/true.go
diff options
context:
space:
mode:
Diffstat (limited to 'true.go')
-rw-r--r--true.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/true.go b/true.go
index 927a77d..31d909c 100644
--- a/true.go
+++ b/true.go
@@ -1,6 +1,7 @@
package env
import (
+ "os"
"strings"
)
@@ -11,10 +12,13 @@ func True(flag string) bool {
return false
}
found := envPB.FindByVar(flag)
- if found == nil {
- return false
+ if found != nil {
+ if strings.ToLower(found.Value) == "true" {
+ return true
+ }
}
- if strings.ToLower(found.Value) == "true" {
+ upper := strings.ToUpper(flag)
+ if os.Getenv(upper) == "true" {
return true
}
return false