If you are using go with homebrew on OSX, add this to your
~/.profile to set the
GOVERSION=$(brew list go | head -n 1 | cut -d '/' -f 6)
export GOROOT=$(brew --prefix)/Cellar/go/$GOVERSION/libexec
libexec, as suggested by @solidfox in the comments.
GOROOT variable should not be necessary in newer versions of go. If you really want to, use:
export GOROOT=$(go env GOROOT)