英文:
i having trouble with GOPATH and Intellij idea
问题
我使用MACOSX 10.10.5,并使用Intellij IDEA作为IDE。
我已经安装了GO SDK(通过从网站下载SDK而不是从Macports下载),并尝试了简单的程序,它可以正常工作。
我尝试使用gorilla库(http://www.gorillatoolkit.org/pkg/mux#overview),所以我设置了GOPATH如下:
- GOPATH=$HOME/work
- PATH=$PATH:$GOPATH/bin
- go get github.com/gorilla/mux
所以我尝试按照这个链接进行修复https://stackoverflow.com/questions/17771091/i-use-intellij-idea-as-golang-ide-and-system-environment-have-already-set-gopat
但对我来说没有起作用。我该如何在Intellij中设置GOPATH?
英文:
I use MACOSX 10.10.5 and use Intellij IDEA as IDE.
I already install GO SDK (by download SDK from website and not from Macports)and try simple program, it work correctly.
I try to use gorilla library (http://www.gorillatoolkit.org/pkg/mux#overview), So I set GOPATH like this
- GOPATH=$HOME/work
- PATH=$PATH:$GOPATH/bin
- go get github.com/gorilla/mux
and Add PATH to intellij, see figure below.
When i import this library IDE throw error like this.
So i try to fixit like this https://stackoverflow.com/questions/17771091/i-use-intellij-idea-as-golang-ide-and-system-environment-have-already-set-gopat
But it do not work for me. how can I set GOPATH in idea?
答案1
得分: 1
你提到的问题是关于旧版本插件的。对于新版本,GOPATH在“设置 | 语言和框架 | Go | Go库”中定义。在那里,你还可以看到是否找到了GOPATH系统环境变量,并添加自定义的GOPATH。
另请参阅文档。
英文:
The question you mentioned is about old version of plugin. For the new version GOPATH is defined in Settings | Languages & Frameworks | Go | Go Libraries
. There you also can see whether GOPATH system environment variable was found or not and add your custom GOPATHs.
See also documentation
答案2
得分: 0
你可以在这里看到菜单路径:
语言和框架 > Go > Go SDK
我正在使用brew,所以当前路径是/usr/local/Cellar/go/1.5.1/libexec。
英文:
Here you can see the menu path:
Languages & Frameworks > Go > Go SDK
I'm using brew, so it's /usr/local/Cellar/go/1.5.1/libexec currently.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论