MCPcopy Create free account
hub / github.com/danielmiessler/Fabric / ParseBool

Function ParseBool

internal/plugins/plugin.go:194–202  ·  view source on GitHub ↗
(val string)

Source from the content-addressed store, hash-verified

192}
193
194func ParseBool(val string) (bool, error) {
195 switch strings.ToLower(strings.TrimSpace(val)) {
196 case "1", "true", "yes", "on":
197 return true, nil
198 case "0", "false", "no", "off":
199 return false, nil
200 }
201 return false, fmt.Errorf(i18n.T("plugin_invalid_bool"), val)
202}
203
204type SetupQuestion struct {
205 *Setting

Callers 6

IsValidMethod · 0.85
PrintMethod · 0.85
FillEnvFileContentMethod · 0.85
ParseBoolElseFalseFunction · 0.85
AskMethod · 0.85
OnAnswerWithResetMethod · 0.85

Calls 1

TFunction · 0.92

Tested by

no test coverage detected