summaryrefslogtreecommitdiff
path: root/true.go
blob: 927a77de719beccb9da788cbe12256c95f281792 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
}