Skip to content

Commit

Permalink
ci: Require go.mod to be tidy
Browse files Browse the repository at this point in the history
This helps us prevent accidentally having an inconsistent go.mod file
after changes to dependencies.
  • Loading branch information
rhcarvalho committed Dec 20, 2019
1 parent d743e93 commit a91b5a8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ before_install:
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/v1.19.1/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.19.1

script:
# If the command below fails, run `go mod tidy`, review and add changes to
# commit.
- '[[ $(go env GOMOD) ]] && go mod tidy && git diff --exit-code'
- golangci-lint run --new-from-rev=$(git merge-base origin/master HEAD)
- go build
- go test
Expand Down

0 comments on commit a91b5a8

Please sign in to comment.