Skip to content

Commit

Permalink
Fix go-verdiff check to handle new .mod files (#1468)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmshort authored Nov 14, 2024
1 parent 0931d5b commit 10e870c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hack/tools/check-go-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ for f in $(find . -name "*.mod"); do
old=${old#go }
new=$(git grep -ohP '^go .*$' "${f}")
new=${new#go }
if [ "${new}" != "${old}" ]; then
# If ${old} is empty, it means this is a new file
if [ "${new}" != "${old}" -a -n "${old}" ]; then
echo "${f}: ${v}: Updated golang version from ${old}"
RETCODE=1
fi
Expand Down

0 comments on commit 10e870c

Please sign in to comment.