Skip to content

Commit 1ac46c6

Browse files
committed
hack/verify-go-modules.sh: only check for stale go.mod
On-behalf-of: SAP [email protected] Signed-off-by: Robert Vasek <[email protected]>
1 parent 4a0adda commit 1ac46c6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

hack/verify-go-modules.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,8 @@ for dir in "${DIRS[@]}"; do
106106
cd "$dir"
107107
echo "Verifying ${dir}"
108108

109-
if ! git diff --quiet HEAD -- go.mod go.sum; then
110-
git --no-pager diff HEAD -- go.mod go.sum
111-
echo "Error: go.mod and/or go.sum in ${dir} files have been modified, inspect and commit them before continuing" 1>&2
109+
if ! go mod tidy -diff ; then
110+
echo "Error: go.mod and/or go.sum is not clean, run 'go mod tidy' before continuing" 1>&2
112111
exit 1
113112
fi
114113

0 commit comments

Comments
 (0)