0

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. Set gorilla library

When i import this library IDE throw error like this.enter image description here

So i try to fixit like this I use IntelliJ IDEA as golang IDE, and system environment have already set GOPATH,But IDEA can't load it

But it do not work for me. how can I set GOPATH in idea?

Community
  • 1
  • 1
B5I5
  • 23
  • 4
  • Are you using the version out of the IntelliJ plugin repository or the nightly/alpha builds from [here](https://github.com/go-lang-plugin-org/go-lang-idea-plugin)? The latest builds should autodetect `$GOPATH`. – Lander Oct 02 '15 at 03:08

2 Answers2

1

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

Community
  • 1
  • 1
0

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.