@dimensi0n It took me a little bit, as a new gopher, to really get and appreciate the
GOPATH. Now that I’ve been working with it for a few years, I find it to absolutely be one of the best features of the language.
It gives me a consistent location for storing my source code, as well as for finding the source code I depend on. Because I use GitHub, I know for a fact that all of my Go code will be under
$GOPATH/src/github.com/theckman. If I am forking a project to make some changes to it I can create the fork in my
GOPATH, using the original name, and can then use it from my project with my modifications. It also gives me a prescriptive location to put code that I contribute to.
It’s also the path where dependencies are found, and because we use the canonical name for our imports (
github.com/theckman/example), your GOPATH needs to ensure your code is in that location (
I’d say give the GOPATH a real try, and have an open mind. If you treat it as the canonical location for where all of your Go projects are going to live, it’ll make things more clear in the long-run and you’ll be working in a way that’s consistent with the Go community. Keeping yourself aligned with the community means you have more resources available to you as you learn the language.
on the GOPATH.