go install: 没有目录的安装位置

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

go install: no install location for directory

问题

我遇到了错误go install: no install location for directory

我的$GOPATH环境变量设置得很好。我遇到的问题是,我不想在我的go工作空间中进行开发。或者说这是我唯一的选择吗?

我有一个存放在其他地方的git仓库,我想在那里进行开发,如果二进制文件编译到$GOPATH中,那也没问题,但我希望能够从任意目录编译/运行构建。

我不希望其他合作者必须将仓库克隆到他们的go工作空间中。这对我来说似乎是一个严重的限制。

英文:

I get the error go install: no install location for directory.

My $GOPATH environment variable is set just fine. The issue I have is that I don't want to develop inside my go workspace. Or is this my only choice?

I have a git repo sitting somewhere else and I would like to work inside there, if the binaries are compiled into the $GOPATH that is fine - but I'd expect to be able to compile / run builds from an arbitrary directory.

I wouldn't expect another collaborator to have to clone the repo into their go workspace? That seems like a serious limitation to me.

答案1

得分: 7

要翻译的内容如下:

要么:

  1. 更改你的GOPATH
  2. 在GOPATH中添加更多条目
  3. 不使用go编译,而是使用编译器和链接器本身

> 我不希望其他合作者必须将存储库克隆到他们的go工作区中。这对我来说似乎是一个严重的限制。

不是的。这正是“go工作区”所用的。

英文:

Either:

  1. Change your GOPATH
  2. Add more entries to GOPATH
  3. Don't compile with go, but the compiler and linker themself

> I wouldn't expect another collaborator to have to clone the repo into their go workspace? That seems like a serious limitation to me.

It is not. That is exactly what a "go workspace" is for.

huangapple
  • 本文由 发表于 2013年10月2日 03:10:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/19124017.html
匿名

发表评论

匿名网友

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

确定