travis-ci/travis-build — pull request #23 by peterbourgon (2012-07-10 21:21:29+00:00)
Title: Convert 'go get .' method to 'go get -d && go build'

After some discussion on the mailing list and with some colleagues, I think this method is a lot more robust.

We still establish a GOPATH at an arbitrary location, but we no longer need to put the checked-out code in a specific location within it. Instead, we use GOPATH simply as a place to store downloaded dependencies (via `go get -d`) and, later, to look for them during the build step (via `go build`).

`go build` makes no demands on the location of the folder it's called in. It simply uses GOPATH to find referenced imports, and builds whatever artifacts it will build in-place.

I think this is a robust building method that should work well for any Go 1.x.x project. It closely tracks what happens when someone would `go get` a repo remotely, which is the canonical use-case for Go code and something Travis should take care not to conflict with.