8 ms·
I made[1] a zsh hook some time ago that allowed you to have per-project GOPATH. At the root of the project I just have to do `echo 'github.com/username/package
by strkek 8y ago
I made[1] a zsh hook some time ago that allowed you to have per-project GOPATH.
At the root of the project I just have to do `echo 'github.com/username/package' > .gopkg` and after that, for everything I do under that directory tree, GOPATH will be automatically set to something like `export GOPATH="$(dirname .gopkg)/.gopath"`.
I don't use zsh anymore though.
[1]: https://gist.github.com/strkek/294c2f5e6fe94b8303b5121266b27a22 https://gist.github.com/strkek/294c2f5e6fe94b8303b5121266b27...
- zimbatm 8y agonice, you could do something similar using direnv[1] [1]: https://direnv.net/ https://direnv.net/