Last active
March 8, 2020 21:01
-
-
Save mahdyadi/028670b4f39b7e8960690f9bf8abab7a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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