diff options
| author | Jeff Carr <[email protected]> | 2025-11-02 21:09:25 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-11-02 21:09:25 -0600 |
| commit | 9dca9f362a25f1bfa92c6f5eccce063b0e380ced (patch) | |
| tree | 88c3274c8d20d908ebf1ecafd8a98c77200ec1b9 /true.go | |
| parent | 200b76da8a0dd95b524d44e90a92106a9699d9fd (diff) | |
Diffstat (limited to 'true.go')
| -rw-r--r-- | true.go | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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 |
