From 9a56fecb753c8b9e43ac8d9776c3209bf22c5569 Mon Sep 17 00:00:00 2001 From: Julien Pivotto <291750+roidelapluie@users.noreply.github.com> Date: Fri, 9 Jan 2026 17:52:38 +0100 Subject: [PATCH] scripts: use git ls-files and check go.work files in version check Update check-go-mod-version.sh to use git ls-files instead of find for better performance and to respect .gitignore. Also include go.work files in the version check to ensure consistency across workspace files and modules. Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com> --- scripts/check-go-mod-version.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/check-go-mod-version.sh b/scripts/check-go-mod-version.sh index d651a62036..96317de2e6 100755 --- a/scripts/check-go-mod-version.sh +++ b/scripts/check-go-mod-version.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash -readarray -t mod_files < <(find . -type f -name go.mod) +readarray -t mod_files < <(git ls-files go.mod go.work '*/go.mod' || find . -type f -name go.mod -or -name go.work) echo "Checking files ${mod_files[@]}" matches=$(awk '$1 == "go" {print $2}' "${mod_files[@]}" | sort -u | wc -l) if [[ "${matches}" -ne 1 ]]; then - echo 'Not all go.mod files have matching go versions' + echo 'Not all go.mod/go.work files have matching go versions' exit 1 fi