summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-11-02 21:09:25 -0600
committerJeff Carr <[email protected]>2025-11-02 21:09:25 -0600
commit9dca9f362a25f1bfa92c6f5eccce063b0e380ced (patch)
tree88c3274c8d20d908ebf1ecafd8a98c77200ec1b9
parent200b76da8a0dd95b524d44e90a92106a9699d9fd (diff)
also check os.Getenv()HEADv0.0.14masterdevel
-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