TextVar defines a flag with a specified name, default value, and usage string. The argument p must be a pointer to a variable that will hold the value of the flag, and p must implement encoding.TextUnmarshaler. If the flag is used, the flag value will be passed to p's UnmarshalText method. The type
(p encoding.TextUnmarshaler, name string, value encoding.TextMarshaler, usage string)
| 62 | |
| 63 | // TextVar defines a flag with a specified name, default value, and usage string. The argument p must be a pointer to a variable that will hold the value of the flag, and p must implement encoding.TextUnmarshaler. If the flag is used, the flag value will be passed to p's UnmarshalText method. The type of the default value must be the same as the type of p. |
| 64 | func (f *FlagSet) TextVar(p encoding.TextUnmarshaler, name string, value encoding.TextMarshaler, usage string) { |
| 65 | f.VarP(newTextValue(value, p), name, "", usage) |
| 66 | } |
| 67 | |
| 68 | // TextVarP is like TextVar, but accepts a shorthand letter that can be used after a single dash. |
| 69 | func (f *FlagSet) TextVarP(p encoding.TextUnmarshaler, name, shorthand string, value encoding.TextMarshaler, usage string) { |