diff --git a/.travis.yml b/.travis.yml index 973f51e770..36a003e281 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,6 +54,9 @@ jobs: # that would be trimmed by 'go mod tidy' echo "Checking that generated files are the same as checked-in versions." git diff --exit-code -- ':!*.pb.go' ':!*_string.go' ':!go.*' + - name: "gomod" + before_script: go mod tidy -v + script: git diff --exit-code -- go.mod go.sum - name: "lint" before_install: true install: diff --git a/scripts/presubmit.sh b/scripts/presubmit.sh index 23d70e1c7d..e4244242a1 100755 --- a/scripts/presubmit.sh +++ b/scripts/presubmit.sh @@ -81,6 +81,8 @@ main() { gofmt -s -w ${go_srcs} echo 'running goimports' goimports -w ${go_srcs} + echo 'running go mod tidy' + go mod tidy fi if [[ "${run_build}" -eq 1 ]]; then