Skip to content

Instantly share code, notes, and snippets.

@mahdyadi
Last active March 8, 2020 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mahdyadi/028670b4f39b7e8960690f9bf8abab7a to your computer and use it in GitHub Desktop.
Save mahdyadi/028670b4f39b7e8960690f9bf8abab7a to your computer and use it in GitHub Desktop.
package cmd
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "simple-cli",
}
func init() {
rootCmd.AddCommand(helloCmd)
}
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment