package version import ( "fmt" ) import ( "github.com/spf13/cobra" ) import ( "resource-server/common" ) var ( StartCmd = &cobra.Command{ Use: "version", Short: "Get version info", Example: "resource-server version", PreRun: func(cmd *cobra.Command, args []string) { }, RunE: func(cmd *cobra.Command, args []string) error { return run() }, } ) func run() error { fmt.Printf("module: %s\n", common.Module) fmt.Printf("desc: %s\n", common.Desc) fmt.Printf("version: %s\n", common.Version) fmt.Printf("build: %s\n", common.Build) return nil }