server.go 441 B

123456789101112131415161718192021222324252627
  1. package version
  2. import (
  3. "fmt"
  4. "git.cestong.com.cn/cecf/hx-admin-server/common/global"
  5. "github.com/spf13/cobra"
  6. )
  7. var (
  8. StartCmd = &cobra.Command{
  9. Use: "version",
  10. Short: "Get version info",
  11. Example: "go-admin version",
  12. PreRun: func(cmd *cobra.Command, args []string) {
  13. },
  14. RunE: func(cmd *cobra.Command, args []string) error {
  15. return run()
  16. },
  17. }
  18. )
  19. func run() error {
  20. fmt.Println(global.Version)
  21. return nil
  22. }