mirror of
https://github.com/beego/bee.git
synced 2024-11-21 23:50:54 +00:00
Dynamic access Go version
This commit is contained in:
parent
25fccbdf91
commit
270a52100c
10
version.go
10
version.go
@ -4,10 +4,11 @@ import (
|
|||||||
"bufio"
|
"bufio"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"os/exec"
|
||||||
path "path/filepath"
|
path "path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"runtime"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var cmdVersion = &Command{
|
var cmdVersion = &Command{
|
||||||
@ -29,7 +30,12 @@ func init() {
|
|||||||
func versionCmd(cmd *Command, args []string) {
|
func versionCmd(cmd *Command, args []string) {
|
||||||
fmt.Println("bee :" + version)
|
fmt.Println("bee :" + version)
|
||||||
fmt.Println("beego :" + getbeegoVersion())
|
fmt.Println("beego :" + getbeegoVersion())
|
||||||
fmt.Println("Go :" + runtime.Version())
|
//fmt.Println("Go :" + runtime.Version())
|
||||||
|
goversion, err := exec.Command("go", "version").Output()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
fmt.Println("Go :" + string(goversion))
|
||||||
}
|
}
|
||||||
|
|
||||||
func getbeegoVersion() string {
|
func getbeegoVersion() string {
|
||||||
|
Loading…
Reference in New Issue
Block a user