package main import ( "flag" "fmt" ) func main() { f := flag.NewFlagSet("example", flag.ExitOnError) var name string f.StringVar(&name, "name", "World", "Name to greet") f.Parse([]string{"-name", "Alice"}) fmt.Printf("Hello, %s!\n", name) }In this example, we define a new flag set with the name "example". We then create a new string flag called "name", with a default value of "World" and a usage message of "Name to greet". We then parse the command line arguments, specifying the value of the "name" flag as "Alice". Finally, we print out a greeting using the value of the "name" flag. The `FlagSet` type and the `StringVar` method are part of the `flag` package in the Go standard library.