File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed
Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,9 @@ install-lll:
4848check-fmt : install-lll
4949 etc/check_fmt.sh
5050
51- # check-modules runs "go mod tidy" and exits with a non-zero exit code if there
52- # are any module changes. The intent is to confirm that exactly the required
53- # modules are declared as dependencies. We should always be able to run "go mod
54- # tidy" and expect that no unrelated changes are made to the "go.mod" file.
5551.PHONY : check-modules
5652check-modules :
57- go mod tidy -v
58- git diff --exit-code go.mod go.sum
53+ etc/check_modules.sh
5954
6055.PHONY : doc
6156doc :
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # check-modules runs "go mod tidy" on each module and exits with a non-zero exit code if there
3+ # are any module changes. The intent is to confirm that exactly the required
4+ # modules are declared as dependencies. We should always be able to run "go mod
5+ # tidy" and expect that no unrelated changes are made to the "go.mod" file.
6+ set -eu
7+
8+ mods=$( find . -name go.mod)
9+ for mod in $mods ; do
10+ pushd $( dirname $mod ) > /dev/null
11+ echo " Checking $mod ..."
12+ go mod tidy -v
13+ git diff --exit-code go.mod go.sum
14+ echo " Checking $mod ... done"
15+ popd > /dev/null
16+ done
You can’t perform that action at this time.
0 commit comments