I use IntelliJ IDEA as golang IDE in Windows , and system environment have already set GOPATH,but IDEA can\'t load $GOPATH.
I use go get github.com/astaxie/beego
According to the release notes of the new version of Gogland (EAP 16), the corresponding Go plugin can only be used with IntelliJ IDEA Ultimate from now on. This follows the pattern of providing support for different languages either via a plugin for IntelliJ IDEA Ultimate, or as a standalone IDE, such as PyCharm, Webstorm, or in this case, Goland.
For more details see the related blog post.
As an alternative solution that ultimately deals with the OP's problem, I would like to recommend the new IDE specifically for Go development, JetBrains Gogland. The setup is pretty much effortless, but in case you would have difficulties, there is already heplful documentation provided.
Check Gogland, might work for you.
There is also an official plugin that "has everything you could find in Gogland".
In case you are wondering what could be the difference between this new plugin, and the old go-lang-idea-plugin
, check the FAQ article with the explanation.
On OS X Mavericks, Go installed via Macports. Using Go plugin version 0.9.15 with IntelliJ IDEA.
I wanted to make the IDE understand the imports and provide autocomplete for any package I have installed in GOPATH. (I started creating an app using Revel and were missing the autocomplete...)
Here is what I did:
Hope this might be what you were looking for!
IDEA plugin for Go does not understand GOPATH as it is defined by Go conventions, it uses only GOROOT, which is determined from SDK. The best workaround is to make symbolic links in GOROOT to packages in GOPATH:
$GOPATH/src/github.com <-- $GOROOT/src/pkg/github.com
$GOPATH/src/code.google.com <-- $GOROOT/src/pkg/code.google.com
... etc
It should be possible to do in Windows too.
This is where you set GOPATH in IntelliJ 2016 (in my case my GOPATH is /development/workspace/golang)
I don't use IntelliJ, but i have a similar issue with Eclipse. I'm probably doing something wrong but Eclipse does not recognize the GOPATH env variable by itself.
What I do is adding manually to the Go settings an entry to the library i am using. For example it would looks like /somewhere/in/your/hd/github.com/astaxie/beego. Note that you have to specify the base directory of your library, not the /src or /pkg folder.
Hope this helps.
Try the latest version of the plugin. It should work better since 0.9.15 release.
And feel free to help us out or report any bugs you encounter.
In your system setting make sure all these enviroment variables are set in this way
GOROOT=C:\Go
GOBIN=%GOPATH%\bin
PATH=%PATH%;c:\go\bin;%GOBIN%
(If you have installed Go in c:\Go
)
In your user folder create a directory for Go, named for example goplayground
Create another environment variable that points to this directory
GOPATH=C:\Users\YOUR_USENAME\goplayground
That's all. Now IntelliJ IDEA Go plugin should work correctly.