Hacker News new | ask | show | jobs
by sonaltr 2803 days ago
I whole heartedly agree with the author.

While I disagree with GO's style guide and a ton of other choices - I don't mind following them since that's what the language requires. But it goes past that and wants me to organize everything my working directory just for it - it's absolutely crossing a line.

While I didn't stop using Go because of GOPATH, it's one of those things that absolutely annoyed the crap out of me.

to the point that all my go projects are now organized as `project_name/go/src/github.com/username/project_name` as an example.

This was really really annoying to say the least.

2 comments

Is it really that hard to solve bad UX of GOPATH? When Go 1.0 came out I remember I couldn't care less about Rob Pike's thoughts on GOPATH and GOROOT and just made a tiny wrapper for go tool that was looking for src/ directory in my tree to populate GOPATH, starting with the current directory (sort of like git does with .git/ directory). And for GOROOT I used a path relative to the wrapper itself.

If you are investing time into learning a new language anyway, these things take very little time in comparison and definitely worth it.

That's funny, but since I started using Go, I now organize all projects under GOPATH, i.e. in `~/src/github.com/user/project`, no matter what language it is in. GOPATH and HOME are almost synonims now.

I find it so much better experience than using tons of `~/Work`, `~/Projects`, `~/Code`, `~/SomeLang/` etc. as I used to have before.

I have been using something similar to ~/site/user/project for years and it worked well so far.
me, too. Personal projects:

~/projects/USER/NAMESPACE/PROJECT

Company projects:

~/projects/COMPANY_SLUG/NAMESPACE/PROJECT