Unable to set GOPATH

When i open a go project, IntelliJ notifies me that the GOPATH is not set.  So i click the link to set the path.  There is no option for me to type in the path.  So I click the "+" button.  It opens a search window and i'm able to navigate to root (/), but /usr is hidden, so it doesn't appear.  So there is no way I can set the GOPATH.

I just learned that i can press shift+command+g to open a "go to the folder" dialog - while i'm in the "open" dialog - where i can type in the path, but that is totally not obvious and is a poor UI decision.  Please consider adding a text box where i can type in a path rather than jumping through multiple hoops.

Official comment

Hi Jeffrey,

Type path in finder on Mac is Cmd+Shift+G (see https://discussions.apple.com/thread/3911493).

Are you sure you have GOPATH under `/usr/` directory? It's unfortunate location. Read more about Go Workspaces here: https://golang.org/doc/code.html#Workspaces

The GOPATH is generally under the HOME directory, having it under /usr is pretty unexpected. Please make sure you are not adding GOROOT (the location of the Go SDK) in the GOPATH.

As for the other problem, the file chooser is the native one from OSX, please use Cmd+Shift+G to see the hidden files. I'll defer to a JetBrains member to see if implementing a non-native file browser is an option or not (like it does on Windows/Linux for example).


Interesting.  When i downloaded the dmg https://dl.google.com/go/go1.10.darwin-amd64.pkg and ran the installer, it installed to /usr/local/go.  I'll have to fix that.  Thank you, that should help make go development much easier for me when its outside of '/usr/'!


The default location for Go to install is /usr/local/go but the source code you are working on should be in a different place. Please follow Alexander's link about the Go Workspace for more details about this.


i have to use different versions of go and i've installed asdf as package manager. and asdf is under ~/.asdf/installs/golang/x

as you can clearly see some people might want to use dot dirs. i had to figure out this cmd+shift+G trick to go.

Help us and put raw input area to GPATH+GOROOT sections. 



@Gokhan Boranalp you can use the instructions mentioned above by Alexander to navigate in your file system:

> Type path in finder on Mac is Cmd+Shift+G (see https://discussions.apple.com/thread/3911493).


@Florin Pățan  did you really read what I've commented?

My message was not for you as a support guy, it was for Jetbrains devs "Please, put a raw input area to GPATH+GOROOT sections of IDE."

Please pass this message to them. Thank you.


@Gokhan Boranalp I read it but if you feel that this should be fixed, then please report it on our issue tracker https://youtrack.jetbrains.com/issues/Go and describe why using the native file chooser from the OS, which works similarly across all macOS apps, is not good enough for this use-case. Thank you.


Please sign in to leave a comment.