美文网首页
gocode配置安装

gocode配置安装

作者: kylelin | 来源:发表于2015-04-04 19:22 被阅读3904次

    【问题】安装gocode命令:sudo go get github.com/nsf/gocode,出现错误提示:

    package github.com/nsf/gocode: cannot download, $GOPATH not set. For more details see: go help gopath
    
    GOARCH="amd64"
    GOBIN="/usr/local/go/bin"
    GOCHAR="6"
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="darwin"
    GOOS="darwin"
    GOPATH="/Users/kyle/go"
    GORACE=""
    GOROOT="/usr/local/go"
    GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
    CC="clang"
    GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
    CXX="clang++"
    CGO_ENABLED="1"
    

    【解决方案】

    sudo env GOPATH=/Users/kyle/go go get github.com/nsf/gocode
    

    【问题】

    sudo go install github.com/nsf/gocode
    
    can't load package: package github.com/nsf/gocode: cannot find package "github.com/nsf/gocode" in any of:
        /usr/local/go/src/github.com/nsf/gocode (from $GOROOT)
        ($GOPATH not set)
    

    【解决方案】

    sudo env GOPATH=/Users/kyle/go go install github.com/nsf/gocode
    

    相关文章

      网友评论

          本文标题:gocode配置安装

          本文链接:https://www.haomeiwen.com/subject/kfsaxttx.html