3 ms·
> I detest the whole GOPATH idea Maybe (or maybe not) you'll find this[0] useful: touch .gopath in some project directory, your GOPATH and PATH will be set aut
by lloeki 12y ago
> I detest the whole GOPATH idea
Maybe (or maybe not) you'll find this[0] useful: touch .gopath in some project directory, your GOPATH and PATH will be set automatically upon cding inside.
Then, work straight on the root for simplest projects or prototyping, or inside src for multi-package projects. In any case, deps will go in src, and you can readily vendor them, or use git submodule, or a simple shell script containing a sequence of "git clone", or not at all. No tool like godep, no import rewriting, no global workspace, per project dependencies, zero overhead.
[0]: https://github.com/lloeki/dotfiles/blob/master/shell/go https://github.com/lloeki/dotfiles/blob/master/shell/go
- ngrilly 12y agoI concur. This is an easy and efficient solution. We do that in my company with one difference: instead of setting the GOPATH depending on the current working directory, we use a Makefile.