.travis.yml raw

   1  language: go
   2  sudo: false
   3  
   4  go:
   5    - 1.10.x
   6    - 1.11.x
   7    - 1.12.x  
   8    - 1.13.x
   9    - 1.14.x
  10    - 1.15.x
  11  
  12  cache:
  13    directories:
  14      - $HOME/.cache/go-build
  15      - $HOME/gopath/pkg/mod
  16  
  17  env:
  18    global:
  19      - GO111MODULE=on
  20  
  21  before_install:
  22    - go get github.com/mattn/goveralls
  23    - go get golang.org/x/tools/cmd/cover
  24    - go get golang.org/x/tools/cmd/goimports
  25    - go get golang.org/x/lint/golint
  26  script:
  27    - gofiles=$(find ./ -name '*.go') && [ -z "$gofiles" ] || unformatted=$(goimports -l $gofiles) && [ -z "$unformatted" ] || (echo >&2 "Go files must be formatted with gofmt. Following files has problem:\n $unformatted" && false)
  28    - golint ./... # This won't break the build, just show warnings
  29    - $HOME/gopath/bin/goveralls -service=travis-ci
  30