Skip to content

Commit

Permalink
Keep go.mod accurate by checking during presubmit
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Percival committed Nov 19, 2019
1 parent fd3985d commit a6efc69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions scripts/presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a6efc69

Please sign in to comment.