1234567891011121314151617181920212223242526 |
- 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
- }
|