package pflag// -- string Valuetype stringValue stringfunc newStringValue( string, *string) *stringValue { * = return (*stringValue)()}func ( *stringValue) ( string) error { * = stringValue()returnnil}func ( *stringValue) () string {return"string"}func ( *stringValue) () string { returnstring(*) }func stringConv( string) (interface{}, error) {return , nil}// GetString return the string value of a flag with the given namefunc ( *FlagSet) ( string) (string, error) { , := .getFlagType(, "string", stringConv)if != nil {return"", }return .(string), nil}// StringVar defines a string flag with specified name, default value, and usage string.// The argument p points to a string variable in which to store the value of the flag.func ( *FlagSet) ( *string, string, string, string) { .VarP(newStringValue(, ), , "", )}// StringVarP is like StringVar, but accepts a shorthand letter that can be used after a single dash.func ( *FlagSet) ( *string, , string, string, string) { .VarP(newStringValue(, ), , , )}// StringVar defines a string flag with specified name, default value, and usage string.// The argument p points to a string variable in which to store the value of the flag.func ( *string, string, string, string) {CommandLine.VarP(newStringValue(, ), , "", )}// StringVarP is like StringVar, but accepts a shorthand letter that can be used after a single dash.func ( *string, , string, string, string) {CommandLine.VarP(newStringValue(, ), , , )}// String defines a string flag with specified name, default value, and usage string.// The return value is the address of a string variable that stores the value of the flag.func ( *FlagSet) ( string, string, string) *string { := new(string) .StringVarP(, , "", , )return}// StringP is like String, but accepts a shorthand letter that can be used after a single dash.func ( *FlagSet) (, string, string, string) *string { := new(string) .StringVarP(, , , , )return}// String defines a string flag with specified name, default value, and usage string.// The return value is the address of a string variable that stores the value of the flag.func ( string, string, string) *string {returnCommandLine.StringP(, "", , )}// StringP is like String, but accepts a shorthand letter that can be used after a single dash.func (, string, string, string) *string {returnCommandLine.StringP(, , , )}
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.