无法使用go get安装Revel。

huangapple go评论81阅读模式
英文:

Can't install Revel with go get

问题

我的go env

GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/xamenrax/code/golang"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.3.2/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.3.2/libexec/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"

但是当我运行go get github.com/robfig/revel时,没有任何输出,这个命令只是静默地不执行任何操作。

英文:

My go env:

GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/xamenrax/code/golang"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.3.2/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.3.2/libexec/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"

But where I'm doing go get github.com/robfig/revel there is no any output, this command just silently do nothing.

答案1

得分: 2

它什么都不做,只是检查$GOPATH/src/github.com/robfig/revel文件夹的内容。

如果该文件夹存在,那么go get很可能已经下载、编译并安装了你的项目。

解决方法是手动执行以下步骤:

  • $GOPATH/src/github.com目录下创建一个robfig文件夹,

  • 在该robfig文件夹中,尝试执行以下命令:

      git clone https://github.com/robfig/revel
    
  • 然后在revel文件夹中,尝试执行go build,然后执行go install

如下所述:

> go build命令应该从$GOPATH/src/github.com/robfig/revel/revel目录下执行。

英文:

It does nothing, but check the content of the $GOPATH/src/github.com/robfig/revel folder.

If that folder exists, chances are the go get did download, compile and install your project.


The workaround is to do it manually:

  • create a robfig folder in $GOPATH/src/github.com, and

  • in that robfig folder, try:

      git clone https://github.com/robfig/revel
    
  • Then in the revel folder, try a go build, then go install

As commented below:

> go build command should be executed from $GOPATH/src/github.com/robfig/revel/revel

huangapple
  • 本文由 发表于 2014年9月30日 20:06:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/26120448.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定