sudo: false
language: go
go:
  - 1.7.x
  - 1.8.x
  - master
matrix:
  allow_failures:
    - go: master
  fast_finish: true
install:
  - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step).
script:
  - go get -t -v ./...
  - diff -u <(echo -n) <(gofmt -d -s .)
  - go generate -x ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) # Check that go generate ./... produces a zero diff; clean up any changes afterwards.
  - go tool vet .
  - go test -v -race ./...

sudo: false
language: go
go:
  - 1.8.x
  - 1.7.x
  - master
matrix:
  allow_failures:
    - go: master
  fast_finish: true
install:
  - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step).
script:
  - go get -t -v ./...
  - diff -u <(echo -n) <(gofmt -d -s .)
  - go generate -x ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) # Check that go generate ./... produces a zero diff; clean up any changes afterwards.
  - go tool vet .
  - go test -v -race ./...
  - go test -v -tags=integration -run=^$ ./test/integration # Check that integration test builds successfully, but don't run any of the tests (they hit live GitHub API).

Check that ./test/integration builds without errors.
Travis: Check that ./test/integration builds without errors.

Checking for build errors in CI will prevent breakages due to API
changes.

Swap position of Go versions so that 1.8 is higher up, since it's
higher priority than 1.7.
