package main import ( "fmt" "github.com/docker/docker/pkg/mflag" ) func main() { fs := mflag.FlagSet{} var name string fs.StringVar(&name, "name", "John Doe", "Specify a name") var age int fs.IntVar(&age, "age", 30, "Specify an age") fs.Parse() fmt.Printf("Name: %s, Age: %d\n", name, age) }
var maxConnections int mflag.IntVar(&maxConnections, "max-connections", 100, "Specify the maximum number of connections")Overall, the "github.com/docker/docker/pkg/mflag" package provides a simple and flexible way to handle flags and arguments in Go command-line applications.