migu_server/cmd/version/server.go

27 lines
409 B
Go
Raw Normal View History

2024-10-18 15:46:54 +00:00
package version
import (
"fmt"
"github.com/spf13/cobra"
"go-admin/common/global"
)
var (
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
}