MCPcopy Index your code
hub / github.com/foxcpp/maddy / ParseBool

Function ParseBool

framework/config/map.go:309–317  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

307}
308
309func ParseBool(s string) (bool, error) {
310 switch strings.ToLower(s) {
311 case "1", "true", "on", "yes":
312 return true, nil
313 case "0", "false", "off", "no":
314 return false, nil
315 }
316 return false, fmt.Errorf("bool argument should be 'yes' or 'no'")
317}
318
319// Bool maps presence of some configuration directive to a boolean variable.
320// Additionally, 'name yes' and 'name no' are mapped to true and false

Callers 1

BoolMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected