MCPcopy
hub / github.com/spf13/pflag / GetBool

Method GetBool

bool.go:39–45  ·  view source on GitHub ↗

GetBool return the bool value of a flag with the given name

(name string)

Source from the content-addressed store, hash-verified

37
38// GetBool return the bool value of a flag with the given name
39func (f *FlagSet) GetBool(name string) (bool, error) {
40 val, err := f.getFlagType(name, "bool", boolConv)
41 if err != nil {
42 return false, err
43 }
44 return val.(bool), nil
45}
46
47// BoolVar defines a bool flag with specified name, default value, and usage string.
48// The argument p points to a bool variable in which to store the value of the flag.

Callers 2

TestGoflagsFunction · 0.95
testParseFunction · 0.80

Calls 1

getFlagTypeMethod · 0.95

Tested by 2

TestGoflagsFunction · 0.76
testParseFunction · 0.64