hack/validate: only search repo-dir for modules

Minor enhancement / follow-up to c8aaeea285c63f9add09e01bd8260d1bce61a97d;
make sure we never attempt to find `go.mod` files in other locations.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2026-01-06 14:53:40 +01:00
parent e3f60d72f4
commit 0d27c51913

View File

@@ -16,7 +16,7 @@ if pkg-config 'libsystemd' 2> /dev/null; then
fi
# Note: exclude github.com/docker/docker/man as it contains no Go code.
mods=($(find . -name "go.mod" -type f -exec dirname {} \; | grep -v "man" | sort -u))
mods=($(find "${REPODIR}" -name "go.mod" -type f -exec dirname {} \; | grep -v "/man" | sort -u))
for mod in "${mods[@]}"; do
pushd "${mod}" > /dev/null
echo -e "\n\033[0;36mINFO\033[0m Start validation for module '${mod}' with golang-ci-lint"