summaryrefslogtreecommitdiff
path: root/true.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-26 22:41:47 -0500
committerJeff Carr <[email protected]>2025-10-26 22:41:47 -0500
commit4d0828def125f96d376cc1bd018bd3d8b0997901 (patch)
treeb683bbe08350c6e5b78eba65be9a6496091c874b /true.go
parent59c9500872620a0e43752d7ebf352804aaf49925 (diff)
rearranging filenames
Diffstat (limited to 'true.go')
-rw-r--r--true.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/true.go b/true.go
new file mode 100644
index 0000000..927a77d
--- /dev/null
+++ b/true.go
@@ -0,0 +1,21 @@
+package env
+
+import (
+ "strings"
+)
+
+func True(flag string) bool {
+ saveMu.Lock()
+ defer saveMu.Unlock()
+ if envPB == nil {
+ return false
+ }
+ found := envPB.FindByVar(flag)
+ if found == nil {
+ return false
+ }
+ if strings.ToLower(found.Value) == "true" {
+ return true
+ }
+ return false
+}