package main import ( "fmt" "github.com/spf13/cobra" ) func main() { rootCmd := &cobra.Command{ Use: "myapp", Short: "A simple CLI app", Long: `This app demonstrates the usage of the cobra package for creating CLI apps in Go`, Run: func(cmd *cobra.Command, args []string) { fmt.Println("Hello from the root command!") }, } rootCmd.Execute() }In the above example, we define a `rootCmd` variable of type `*cobra.Command`. We set this command's `Run` field to a function that prints a message to the console using the `Command.Println()` method. When we execute the `rootCmd` using the `Execute()` method, it will run the function specified in the `Run` field, which will print the message "Hello from the root command!" to the console. Overall, the `github.com/spf13/cobra` package provides robust support for creating CLI applications in Go utilizing many other helpful features such as flags or creating sub-commands using Cobra.