英文:
How to configure GOPATH?
问题
我安装了Goland作为Go IDE,并且它要求我配置GOPATH。我对这门语言还不熟悉,所以不知道该怎么做。以下是错误信息:
> 检测到GOPATH
我们检测到您的GOPATH中存在一些库。
您可能希望在GOPATH配置中添加额外的库。
编辑:这不是一个重复的问题,export GOROOT=""
解决了我的问题。不管怎样,谢谢。
英文:
I installed Goland as a Go IDE and it wants me to configure GOPATH. I'm new in this language so I don't know what to do. Here is the error message:
> GOPATH was detected
We've detected some libraries from your GOPATH.
You may want to add extra libraries in GOPATH configuration.
Edit: Not a duplicate question, export GOROOT=""
solved my problem. Thanks anyway.
答案1
得分: 7
你实际上不需要设置GOPATH
环境变量;在Go 1.8中,默认情况下是~/go
。
我建议你只需更新到最新的稳定版Go(1.8),并使用这个约定;否则你需要在环境中设置GOPATH
变量。
英文:
You actually do not need to set the GOPATH
environment variable; in Go 1.8 it's ~/go
by default.
I suggest that you just update to latest stable Go (1.8) and use that convention; otherwise you'll need to set the GOPATH
variable in your environment.
答案2
得分: 2
你需要设置GOPATH
环境变量。如何设置取决于你的操作系统。
以下是设置PATH
环境变量的示例,只需修改指令以设置GOPATH
即可。
另请参阅如何编写Go代码,了解有关设置工作区和GOPATH
的更多详细信息。
英文:
You need to set the GOPATH
environment variable. How you do this varies depending on your operating system.
Here are examples of how to set the PATH environment variable, just modify the instructions to set GOPATH
instead.
Also see How to Write Go Code for more details on setting up your workspace and setting GOPATH
.
答案3
得分: 1
export GOROOT="" 为某种原因解决了问题。
英文:
export GOROOT=""
solved the issue for some reason.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论