package main import ( "fmt" "github.com/codegangsta/cli" "math" "os" ) func main() { app := cli.NewApp() app.Name = "calc" app.Usage = "calculate the square of a number" app.Action = func(c *cli.Context) error { num := c.Float64("num") square := math.Pow(num, 2) fmt.Printf("%g squared is %g\n", num, square) return nil } app.Flags = []cli.Flag{ cli.Float64Flag{ Name: "num", Value: 0, Usage: "number to be squared", }, } app.Run(os.Args) }In this example, we're using the Context type to retrieve the value of the "num" flag, which is then converted to a Float64 value. The math.Pow() function is used to calculate the square of the number, and the result is printed to the console. The github.com/codegangsta/cli package provides an easy-to-use and efficient framework for building and managing command-line interfaces in Go.