我收到错误 go install: no install location for directory
。
我的 $GOPATH
环境变量设置得很好。我遇到的问题是我不想在我的 go 工作区中开发。还是这是我唯一的选择?
我在其他地方有一个 git repo,我想在里面工作,如果二进制文件被编译成 $GOPATH
那很好 - 但我希望能够编译/从任意目录运行构建。
我不希望其他合作者必须将 repo 克隆到他们的 go 工作区中?这对我来说似乎是一个严重的限制。
最佳答案
要么:
- 更改您的 GOPATH
- 向 GOPATH 添加更多条目
- 不要用 go 编译,而是编译器和链接器自己编译
I wouldn't expect another collaborator to have to clone the repo into their go workspace? That seems like a serious limitation to me.
事实并非如此。这正是“go 工作区”的用途。
关于git - 去安装: no install location for directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19124017/