1
Some checks failed
Build / build (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
build / Build (push) Has been cancelled
GitHub Actions Mirror / mirror_to_gitee (push) Has been cancelled
GitHub Actions Mirror / mirror_to_gitlab (push) Has been cancelled
Issue Close Require / issue-close-require (push) Has been cancelled
Issue Check Inactive / issue-check-inactive (push) Has been cancelled
Some checks failed
Build / build (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
build / Build (push) Has been cancelled
GitHub Actions Mirror / mirror_to_gitee (push) Has been cancelled
GitHub Actions Mirror / mirror_to_gitlab (push) Has been cancelled
Issue Close Require / issue-close-require (push) Has been cancelled
Issue Check Inactive / issue-check-inactive (push) Has been cancelled
This commit is contained in:
26
cmd/version/server.go
Normal file
26
cmd/version/server.go
Normal file
@ -0,0 +1,26 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user