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