StringWithAllowedValues returns a flag variable of type stringFlagWithAllowedValues configured with the provided parameters. 'allowed` is the set of values that this flag can be set to.
(name, defaultVal, usage string, allowed []string)
| 43 | // stringFlagWithAllowedValues configured with the provided parameters. |
| 44 | // 'allowed` is the set of values that this flag can be set to. |
| 45 | func StringWithAllowedValues(name, defaultVal, usage string, allowed []string) *string { |
| 46 | as := &stringFlagWithAllowedValues{defaultVal, allowed} |
| 47 | flag.CommandLine.Var(as, name, usage) |
| 48 | return &as.val |
| 49 | } |
| 50 | |
| 51 | // String implements the flag.Value interface. |
| 52 | func (as *stringFlagWithAllowedValues) String() string { |
no outgoing calls