This commit is contained in:
Liang Ding 2014-11-26 11:07:06 +08:00
parent 8564040c04
commit a579872b9c
1 changed files with 11 additions and 8 deletions

View File

@ -111,21 +111,24 @@ func FixedTimeCheckEnv() {
} }
func checkEnv() { func checkEnv() {
cmd := exec.Command("go", "version")
buf, err := cmd.CombinedOutput()
if nil != err {
glog.Fatal("Not found 'go' command, please make sure Go has been installed correctly")
os.Exit(-1)
}
glog.V(5).Info(string(buf))
if "" == os.Getenv("GOPATH") { if "" == os.Getenv("GOPATH") {
glog.Fatal("Not found $GOPATH, please configure it before running Wide") glog.Fatal("Not found $GOPATH, please configure it before running Wide")
os.Exit(-1) os.Exit(-1)
} }
if "" == os.Getenv("GOROOT") {
glog.Fatal("Not found $GOROOT, please configure it before running Wide")
os.Exit(-1)
}
gocode := Wide.GetExecutableInGOBIN("gocode") gocode := Wide.GetExecutableInGOBIN("gocode")
cmd := exec.Command(gocode, "close") cmd = exec.Command(gocode, "close")
_, err := cmd.Output() _, err = cmd.Output()
if nil != err { if nil != err {
event.EventQueue <- &event.Event{Code: event.EvtCodeGocodeNotFound} event.EventQueue <- &event.Event{Code: event.EvtCodeGocodeNotFound}