Гопат
The GOPATH environment variable lists places to look for Go code.
On Unix, the value is a colon-separated string. On Windows, the value
is a semicolon-separated string. On Plan 9, the value is a list.
GOPATH must be set to get, build and install packages outside the standard Go tree.
Use tool like dep to segregate your different go project, maintaining your project dependencies.
GOROOT
The Go binary distributions assume they will be installed in /usr/local/go (or c:\Go under Windows), but it is possible to install
the Go tools to a different location. In this case you must set the
GOROOT environment variable to point to the directory in which it was installed.
, поэтому всегда предпочтительнее создать свой собственный gopath для компиляции кода.
GOPATH предназначен для ваших собственных проектов go / сторонних библиотек (загружается с помощью "go get").