GetBool return the bool value of a flag with the given name
(name string)
| 37 | |
| 38 | // GetBool return the bool value of a flag with the given name |
| 39 | func (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. |