top | item 15309969

(no title)

ubercow | 8 years ago

My ideal system is: clone a repo, run `go restore` to fetch dependencies and then `go build` to spit out a binary or `go run` to quickly start the main function.

Nothing from outside the repo can effect that build. Likewise anything inside the repo can’t effect the outside.

Compartmentalizing each project makes builds more reproducible and more obvious. If anyone else clones the same repo and runs the same commands, they should get the same result.

discuss

order

jff|8 years ago

We actually do this at work; our repository is a full GOPATH layout with subdirectories for src/, test/, doc/, etc. We vendor our dependencies. To build, we have scripts at the top-level that compile all of our components (we ship a whole suite of tools in a single repo), run go vet, run tests, etc. The user never needs to set GOPATH. It's not a perfect system, but we've been using it for 3+ years without too much trouble.