Skip to content

Commit

Permalink
Merge pull request linode#147 from Charliekenney23/add-gomod-tidy-check
Browse files Browse the repository at this point in the history
add gomod tidy check script
  • Loading branch information
0xch4z committed May 19, 2020
2 parents ade6a71 + e90b6f9 commit d9b9762
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ env:
go:
- "1.13"

before_script:
- bash ./scripts/verify-gomod-tidy.sh

script:
- touch .env
- curl -sfL https://github.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.21.0
Expand Down
13 changes: 13 additions & 0 deletions scripts/verify-gomod-tidy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -e

go mod tidy

if [[ `git status --porcelain` ]]; then
echo 'go.mod needs updating'
echo 'Please run "go mod tidy" to fix dependencies'
exit 1
fi

exit 0

0 comments on commit d9b9762

Please sign in to comment.