32 lines
466 B
Go
32 lines
466 B
Go
|
package version
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
|
||
|
"github.com/spf13/cobra"
|
||
|
|
||
|
"go-admin/common/global"
|
||
|
)
|
||
|
|
||
|
var (
|
||
|
configYml string
|
||
|
port string
|
||
|
mode string
|
||
|
StartCmd = &cobra.Command{
|
||
|
Use: "version",
|
||
|
Short: "Get version info",
|
||
|
Example: "go-admin version",
|
||
|
PreRun: func(cmd *cobra.Command, args []string) {
|
||
|
|
||
|
},
|
||
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||
|
return run()
|
||
|
},
|
||
|
}
|
||
|
)
|
||
|
|
||
|
func run() error {
|
||
|
fmt.Println(global.Version)
|
||
|
return nil
|
||
|
}
|