From 869ca61809f23f7345ced9a86b38f20844668ba1 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 15 Apr 2015 17:01:01 +0800 Subject: [PATCH] enhance runtime dependencies scout --- conf/wide.go | 4 ++-- util/go.go | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/conf/wide.go b/conf/wide.go index c19c03d..a3ee158 100644 --- a/conf/wide.go +++ b/conf/wide.go @@ -277,7 +277,7 @@ func checkEnv() { if nil != err { event.EventQueue <- &event.Event{Code: event.EvtCodeGocodeNotFound} - logger.Warnf("Not found gocode [%s]", gocode) + logger.Warnf("Not found gocode [%s], please install it with this command: go get github.com/nsf/gocode", gocode) } ideStub := util.Go.GetExecutableInGOBIN("ide_stub") @@ -286,7 +286,7 @@ func checkEnv() { if nil != err { event.EventQueue <- &event.Event{Code: event.EvtCodeIDEStubNotFound} - logger.Warnf("Not found ide_stub [%s]", ideStub) + logger.Warnf("Not found ide_stub [%s], please install it with this command: go get github.com/88250/ide_stub", ideStub) } } diff --git a/util/go.go b/util/go.go index 9be9bbd..f2bc284 100644 --- a/util/go.go +++ b/util/go.go @@ -100,5 +100,13 @@ func (*mygo) GetExecutableInGOBIN(executable string) string { } // $GOBIN/executable - return os.Getenv("GOBIN") + pathSeparator + executable + gobin := os.Getenv("GOBIN") + if "" != gobin { + ret = gobin + pathSeparator + executable + if File.IsExist(ret) { + return ret + } + } + + return "./" + executable }