MCPcopy Index your code
hub / github.com/git-lfs/git-lfs / Bool

Function Bool

config/environment.go:114–127  ·  view source on GitHub ↗

Bool returns the boolean state associated with the given value, or the value "def", if the value is blank. The "boolean state associated with a given key" is defined as the case-insensitive string comparison with the following: 1. true if... "true", "1", "on", "yes", or "t" 2. false if... "false",

(value string, def bool)

Source from the content-addressed store, hash-verified

112// 2. false if...
113// "false", "0", "off", "no", "f", or otherwise.
114func Bool(value string, def bool) bool {
115 if len(value) == 0 {
116 return def
117 }
118
119 switch strings.ToLower(value) {
120 case "true", "1", "on", "yes", "t":
121 return true
122 case "false", "0", "off", "no", "f":
123 return false
124 default:
125 return false
126 }
127}

Callers 5

BoolMethod · 0.92
BoolMethod · 0.85
BoolMethod · 0.85
getMaskMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected