Skip to content

Commit 9c2fa11

Browse files
authored
Merge pull request #18404 from hakman/automated-cherry-pick-of-#18401-upstream-release-1.35
Automated cherry pick of #18401: gomod: tidy and verify all modules
2 parents 221dbfc + e36231f commit 9c2fa11

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,10 @@ ko-kops-utils-cp-push:
323323
gomod:
324324
go mod tidy
325325
go mod vendor
326-
cd hack; go mod tidy
327-
cd tests/e2e; go mod tidy
328-
cd tools/otel/traceserver; go mod tidy
326+
for dir in $$(find . -name go.mod -not -path './go.mod' -not -path './vendor/*' -not -path '*/.*' | xargs -n1 dirname | sort); do \
327+
echo "go mod tidy: $$dir"; \
328+
( cd "$$dir" && go mod tidy ); \
329+
done
329330

330331
.PHONY: gofmt
331332
gofmt:

hack/verify-gomod.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ cd "${KOPS_ROOT}"
2424

2525
make gomod
2626

27-
changes=$(git status --porcelain go.mod go.sum vendor/ tests/e2e/go.mod tests/e2e/go.sum || true)
27+
# Check every module's go.mod/go.sum plus the vendored tree, excluding hidden directories
28+
# that aren't part of the source (e.g. .claude worktrees, .idea).
29+
changes=$(git status --porcelain -- '*go.mod' '*go.sum' vendor/ ':(exclude,glob)**/.*/**' || true)
2830
if [ -n "${changes}" ]; then
2931
echo "ERROR: go modules are not up to date; please run: make gomod"
3032
echo "changed files:"

0 commit comments

Comments
 (0)