import "flag" func main() { var verbose bool flags := flag.NewFlagSet("mycommand", flag.ExitOnError) flags.BoolVar(&verbose, "verbose", false, "Enable verbose output") flags.Parse(os.Args[1:]) args := flags.Args() for i, arg := range args { fmt.Printf("Argument %d: %s", i, arg) } }In this example, we create a `FlagSet` for a command called `mycommand`. We define a boolean flag called `verbose`, which can be used with the `-verbose` or `--verbose` option. After parsing the command-line arguments, we use the `Args` method to get a slice of any non-flag arguments that were provided. We then loop through these arguments and print them out. Overall, the `flag` package in Go provides a convenient way to define and manage command-line flags and arguments. It simplifies the process of parsing and handling command-line options, and can help make your command-line tools more user-friendly.