package pflagimport// -- int32 Valuetype int32Value int32func newInt32Value( int32, *int32) *int32Value { * = return (*int32Value)()}func ( *int32Value) ( string) error { , := strconv.ParseInt(, 0, 32) * = int32Value()return}func ( *int32Value) () string {return"int32"}func ( *int32Value) () string { returnstrconv.FormatInt(int64(*), 10) }func int32Conv( string) (interface{}, error) { , := strconv.ParseInt(, 0, 32)if != nil {return0, }returnint32(), nil}// GetInt32 return the int32 value of a flag with the given namefunc ( *FlagSet) ( string) (int32, error) { , := .getFlagType(, "int32", int32Conv)if != nil {return0, }return .(int32), nil}// Int32Var defines an int32 flag with specified name, default value, and usage string.// The argument p points to an int32 variable in which to store the value of the flag.func ( *FlagSet) ( *int32, string, int32, string) { .VarP(newInt32Value(, ), , "", )}// Int32VarP is like Int32Var, but accepts a shorthand letter that can be used after a single dash.func ( *FlagSet) ( *int32, , string, int32, string) { .VarP(newInt32Value(, ), , , )}// Int32Var defines an int32 flag with specified name, default value, and usage string.// The argument p points to an int32 variable in which to store the value of the flag.func ( *int32, string, int32, string) {CommandLine.VarP(newInt32Value(, ), , "", )}// Int32VarP is like Int32Var, but accepts a shorthand letter that can be used after a single dash.func ( *int32, , string, int32, string) {CommandLine.VarP(newInt32Value(, ), , , )}// Int32 defines an int32 flag with specified name, default value, and usage string.// The return value is the address of an int32 variable that stores the value of the flag.func ( *FlagSet) ( string, int32, string) *int32 { := new(int32) .Int32VarP(, , "", , )return}// Int32P is like Int32, but accepts a shorthand letter that can be used after a single dash.func ( *FlagSet) (, string, int32, string) *int32 { := new(int32) .Int32VarP(, , , , )return}// Int32 defines an int32 flag with specified name, default value, and usage string.// The return value is the address of an int32 variable that stores the value of the flag.func ( string, int32, string) *int32 {returnCommandLine.Int32P(, "", , )}// Int32P is like Int32, but accepts a shorthand letter that can be used after a single dash.func (, string, int32, string) *int32 {returnCommandLine.Int32P(, , , )}
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.