28 lines
494 B
Go
28 lines
494 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"git.bloy.org/mike/gotest/version"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var rootCmd = &cobra.Command{
|
|
Use: "gotest",
|
|
Short: "Gotest is a thing for testing out go packaging and boilerplate",
|
|
Long: "An Experiment",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
fmt.Println("Hello world!")
|
|
},
|
|
Version: version.Version.String(),
|
|
}
|
|
|
|
// Execute the root command
|
|
func Execute() {
|
|
if err := rootCmd.Execute(); err != nil {
|
|
fmt.Println(err)
|
|
os.Exit(1)
|
|
}
|
|
}
|