.travis.yml 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. language: go
  2. os:
  3. - linux
  4. - osx
  5. install:
  6. # Use gofmt from Go 1.9 for the pre-build check on all builds
  7. - if [ "$TRAVIS_OS_NAME" = "osx" ]; then wget -O go.tar.gz https://storage.googleapis.com/golang/go1.9.darwin-amd64.tar.gz; else wget -O go.tar.gz https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz; fi
  8. - tar -C /tmp -xvf go.tar.gz go/bin/gofmt
  9. - rm go.tar.gz
  10. before_script:
  11. - /tmp/go/bin/gofmt -w .
  12. # If `go generate` or `gofmt` yielded any changes,
  13. # this will fail with an error message like "too many arguments"
  14. # or "M: binary operator expected" and show the diff.
  15. - git diff
  16. - git add .
  17. - git diff-index --cached --exit-code HEAD
  18. go:
  19. - 1.7
  20. - 1.8
  21. - 1.9
  22. - tip
  23. matrix:
  24. include:
  25. - os: linux
  26. go: 1.6
  27. script:
  28. - echo $TRAVIS_GO_VERSION
  29. - if [ "$TRAVIS_GO_VERSION" == "1.6" ] || [ "$TRAVIS_GO_VERSION" == "1.7" ] || [ "$TRAVIS_GO_VERSION" == "1.8" ]; then go list ./... | grep -v vendor | xargs go test -race -v -timeout 60s; else go test -race -v -timeout 60s ./...; fi