app := cli.NewApp() app.Action = func(ctx *cli.Context) error { fmt.Println("Hello, world!") return nil } app.Run(os.Args)
timeString := "1h30m" duration, err := time.ParseDuration(timeString) if err != nil { fmt.Println(err) return } fmt.Println("Duration: ", duration)In both examples, we can see that we are using functions and types from the `github.com/urfave/cli` package. This package provides easy-to-use APIs for building command-line applications in Go.