forked from mongodb/mongo-go-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
# check-modules runs "go mod tidy" on each module and exits with a non-zero exit code if there | ||
# are any module changes. The intent is to confirm that exactly the required | ||
# modules are declared as dependencies. We should always be able to run "go mod | ||
# tidy" and expect that no unrelated changes are made to the "go.mod" file. | ||
set -eu | ||
|
||
mods=$(find . -name go.mod) | ||
for mod in $mods; do | ||
pushd $(dirname $mod) > /dev/null | ||
echo "Checking $mod..." | ||
go mod tidy -v | ||
git diff --exit-code go.mod go.sum | ||
echo "Checking $mod... done" | ||
popd > /dev/null | ||
done |