package main import ( "github.com/minio/cli" ) func main() { app := cli.NewApp() app.Flags = []cli.Flag{ &cli.StringFlag{ Name: "global-string", Value: "default value", Usage: "description of global string flag", Destination: &cli.GlobalString, }, } app.Run(os.Args) }
package main import ( "fmt" "github.com/minio/cli" ) func main() { fmt.Println(cli.GlobalString) }In this example, we simply print the current value of "GlobalString" to the console.