vendor/github.com/spf13/pflag/README.md
changeset 251 1c52a0eeb952
parent 242 2a9ec03fe5a1
equal deleted inserted replaced
250:c040f992052f 251:1c52a0eeb952
    84 ``` go
    84 ``` go
    85 fmt.Println("ip has value ", *ip)
    85 fmt.Println("ip has value ", *ip)
    86 fmt.Println("flagvar has value ", flagvar)
    86 fmt.Println("flagvar has value ", flagvar)
    87 ```
    87 ```
    88 
    88 
    89 There are helpers function to get values later if you have the FlagSet but
    89 There are helper functions available to get the value stored in a Flag if you have a FlagSet but find
    90 it was difficult to keep up with all of the flag pointers in your code.
    90 it difficult to keep up with all of the pointers in your code.
    91 If you have a pflag.FlagSet with a flag called 'flagname' of type int you
    91 If you have a pflag.FlagSet with a flag called 'flagname' of type int you
    92 can use GetInt() to get the int value. But notice that 'flagname' must exist
    92 can use GetInt() to get the int value. But notice that 'flagname' must exist
    93 and it must be an int. GetString("flagname") will fail.
    93 and it must be an int. GetString("flagname") will fail.
    94 
    94 
    95 ``` go
    95 ``` go