package main import ( "flag" "fmt" ) func main() { wordPtr := flag.String("word", "foo", "a string") numbPtr := flag.Int("numb", 42, "an int") forkPtr := flag.Bool("api", false, "Start Api Server") var svar string flag.StringVar(&svar, "svar", "bar", "a string var") flag.Parse() fmt.Println("word:", *wordPtr) fmt.Println("numb:", *numbPtr) fmt.Println("api:", *forkPtr) fmt.Println("svar:", svar) fmt.Println("tail:", flag.Args()) }