1
0
mirror of https://github.com/beego/bee.git synced 2024-12-22 15:10:49 +00:00

Dynamic access Go version

This commit is contained in:
astaxie 2014-08-11 08:57:20 +08:00
parent 25fccbdf91
commit 270a52100c

View File

@ -4,10 +4,11 @@ import (
"bufio"
"fmt"
"io"
"log"
"os"
"os/exec"
path "path/filepath"
"regexp"
"runtime"
)
var cmdVersion = &Command{
@ -29,7 +30,12 @@ func init() {
func versionCmd(cmd *Command, args []string) {
fmt.Println("bee :" + version)
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 {