import ( "flag" "fmt" ) func main() { var flagVal bool fs := flag.NewFlagSet("myFlags", flag.ExitOnError) fs.BoolVar(&flagVal, "myFlag", false, "a boolean flag") fs.Parse(os.Args[1:]) if flagVal { fmt.Println("myFlag is set to true") } else { fmt.Println("myFlag is set to false") } }In this example, we create a new FlagSet object called "myFlags", which defines a boolean flag "myFlag" with a default value of false. We then parse the command-line arguments using the Parse method, which sets the value of flagVal based on whether the "myFlag" flag is present and set to true. Finally, we print the current value of flagVal, which will be either true or false depending on the command-line arguments. In this case, the package library is the standard library "flag" package.