英文:
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
要翻译的内容如下:
要么:
- 更改你的GOPATH
- 在GOPATH中添加更多条目
- 不使用go编译,而是使用编译器和链接器本身
> 我不希望其他合作者必须将存储库克隆到他们的go工作区中。这对我来说似乎是一个严重的限制。
不是的。这正是“go工作区”所用的。
英文:
Either:
- Change your GOPATH
- Add more entries to GOPATH
- 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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论