Created
July 29, 2018 03:03
-
-
Save qbig/6e38832de6d06b1e67f3c447f07374d6 to your computer and use it in GitHub Desktop.
Parsing flags with https://github.com/spf13/pflag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
import flag "github.com/spf13/pflag" | |
func main() { | |
var f1 *int = flag.Int("f1", 1, "help message for flagname") | |
var f2 *int = flag.Int("f2", 2, "help message for flagname") | |
flag.Parse() | |
fmt.Println(*f1) | |
fmt.Println(*f2) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment