Search code examples
intellij-ideagogoogle-go-idea-plugin

golang-idea-plugin: how to set project-specific GOPATH?


I'm trying to migrate from Goclipse dev environment to IDEA. Could not find a killing feature in golang-idea-plugin, that exists in Goclipse - each GO project automatically adds itself as a GOPATH item for Eclipse session, so I don't have to put it to global GOPATH manually. This is extremely useful, as I don't want to mix my local code with globally grabbed ones (I don't plan to share my code in any ways), plus several projects are distinguished from each other in their envs. But I did not found any kind of this feature in golang IDEA plugin, so my builds keep failing with follows:

cannot find package "wnd/modules/network" in any of:
C:\go\src\wnd\modules\network (from $GOROOT)
c:\gopath\src\wnd\modules\network (from $GOPATH)

Are there any cures for this within IDEA?


Solution

  • If you are using the latest version of the plugin see the repository then you are able to fully customize the GOPATH layout. You can chose to have global entries, which are persisted for all your projects, or per project entries, which are project specific entries. You can really be creative with the options.