4 ms·
Do most Go programmers put all their code under ~/go, or do they tend to set GOPATH on a project-by-project basis?
by iainmerrick 9y ago
Do most Go programmers put all their code under ~/go, or do they tend to set GOPATH on a project-by-project basis?
- bacongobbler 9y agoMost put it under ~/go. It's quick and easy.
- foo101 9y agoMost set the GOPATH. It's quick and easy.
- clra 9y agoQuite a few current Go programmers will have something set other than `~/go` because that default only came in very recently, but you'll probably find that almost everyone uses `~/go` or `$GOPATH`. One thing that you learn quickly when starting Go is that fighting the language's idioms (even where they're questionable) isn't going to be a good time.
- iainmerrick 9y agoYeah, that's pretty much why I haven't learned Go. :)
- oelmekki 9y agoDon't know about others, but since I run my projects in containers anyway, I'll usually use `direnv` on my host to set GOPATH to project directory, and then use the default GOPATH in go docker images (`/go`). I could even do without direnv altogether, but I need it so that vim-go can report build errors on file saving.
- petepete 9y agoI use virtualgo[0] so I can organise my work properly and not mix my own stuff up with loads of unrelated libraries [0] https://github.com/getstream/vg https://github.com/getstream/vg