by ubercow · 9y ago · 0 comments
I know this is super nitpicky, but I like to keep work and personal code completely separate and changing GOPATHs is very frustrating.
With the introduction of `vendor` and software like glide and dep tool, you no longer have to store your sources in `$GOPATH/src`.
Since dep/glide are also required for sane dependency version management, there seems to be no benefit of using `src` over `vendor`.
Without `src`, is there any reason `GOPATH` is still required?
I really like Go, it's so nice for server side applications.
export GOPATH=/home/ubercow/project2/
Or even: export GOPATH=`pwd`
When it's time to work on your project just say . source
This seems like an INCREDIBLY minor step to take. It's certainly no worse than using pyenv.Or have a GOPATH with two dirs like:
GOPATH="~/workgo:~/homego"How would your ideal system look like? What is your use case?
Sidenote if it helps there is a default gopath location if its not defined: https://golang.org/doc/go1.8#gopath
Nothing from outside the repo can effect that build. Likewise anything inside the repo can’t effect the outside.
Compartmentalizing each project makes builds more reproducible and more obvious. If anyone else clones the same repo and runs the same commands, they should get the same result.