3 ms·
1. setting GOPATH as $HOME made me uncomfortable, I don't see why anyone would want to pollute his/her home directory with bin, pkg, and src folders. 2. in his
by baby 10y ago
1. setting GOPATH as $HOME made me uncomfortable, I don't see why anyone would want to pollute his/her home directory with bin, pkg, and src folders.
2. in his example, `go get github.com/your-username/hello` also automatically compile the thing into a binary in `$GOPATH/bin`. Is that correct?
- zeveb 10y agoI like to do this for my main Go path (I use per-project ones as needed), since I want ~/bin and ~/src (the former is where all of my personal binaries go, and the latter is where all of my personal source trees go). I guess I don't really mind that there's a ~/pkg — I might mind quite a bit more if I ever used a GUI file manager, but I never do that.
- didip 10y agoI don't think GOPATH as $HOME is a common thing (even back then). A lot more people uses $HOME/go as GOPATH. So much so that $HOME/go is the default in Go 1.8.
- hazbo 10y agoTo answer 2) yes, you're correct. If there is a main package that exists at `github.com/your-username/hello`, a go get will leave the resulting binary in $GOPATH/bin.
- gcb0 10y agothat whole thing is so subversion.