Where does go get install packages?

I had a similar problem which is why I found your question. However, in my case I did not have an empty GOPATH but one with multiple directories. I worked out the issue and describe it here...

If you run go get and you already have the package it says nothing (even with the -v option). This is confusing if it's not in the first directory of your GOPATH. Ie you run go get , there is no error or any message but when you check the first directory of the GOPATH (which is where the doc says it should be) you can't find it.

I eventually found it, but since I have a large GOPATH this was rather tedious.


I found the missing clue by running brew info go, which says:

==> Caveats
A valid GOPATH is required to use the `go get` command.
If $GOPATH is not specified, $HOME/go will be used by default:
  https://golang.org/doc/code.html#GOPATH

From that I found the executable in question at $HOME/go/bin.


go env

you can get the path from GOMODCACHE

Tags:

Go

Homebrew