We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31da5e6 commit d1e963cCopy full SHA for d1e963c
script/generate.sh
@@ -8,10 +8,28 @@ set -e
8
9
CDPATH="" cd -- "$(dirname -- "$0")/.."
10
11
+CHECK_MODE=0
12
if [ "$1" = "--check" ]; then
13
export CHECK=1
14
+ CHECK_MODE=1
15
fi
16
17
go generate ./...
18
19
+MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname | sort)"
20
+
21
+for dir in $MOD_DIRS; do
22
+ (
23
+ cd "$dir"
24
+ if [ "$CHECK_MODE" = "1" ]; then
25
+ if ! go mod tidy -diff; then
26
+ echo "go.mod/go.sum are out of date in $dir"
27
+ exit 1
28
+ fi
29
+ else
30
+ go mod tidy
31
32
+ )
33
+done
34
35
script/run-check-structfield-settings.sh -fix
0 commit comments