Skip to content

Commit

Permalink
Merge pull request #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 authored May 19, 2020
2 parents 8d20f69 + 0b6e1d1 commit b67652b
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://raw.githubusercontent.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 b67652b

Please sign in to comment.