Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package main
import (
"flag"
"fmt"
)
type Profile struct {
Name string
Age uint
Verified bool
}
func main() {
var version string
var profile Profile // new added
flag.StringVar(&version, "setVersion", "1.0.0", "")
flag.Var(&profile, "setProfile", "") // new added
flag.Parse()
fmt.Println("version = ", version)
fmt.Println("profile = ", profile) // new added
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment