From a81fdad21635cba2aad2cb090566e737c4ed71c8 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 21 Nov 2024 22:17:11 +0100 Subject: [PATCH] Use existing go version in go mod tidy and verify This change ensures that running make mod-tidy doesn't update the go version specified in the mod files. Signed-off-by: Evan Lezar --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bc06c92..6299751 100644 --- a/Makefile +++ b/Makefile @@ -74,14 +74,14 @@ $(BINARIES): bin/%: mod-tidy: $(Q)for mod in $$(find . -name go.mod); do \ echo "Tidying $$mod..."; ( \ - cd $$(dirname $$mod) && go mod tidy \ + cd $$(dirname $$mod) && go mod tidy -go=$$(grep -E "^go\s+\d\.\d+$$" go.mod | sed 's/^go //') \ ) || exit 1; \ done mod-verify: $(Q)for mod in $$(find . -name go.mod); do \ echo "Verifying $$mod..."; ( \ - cd $$(dirname $$mod) && go mod verify | sed 's/^/ /g' \ + cd $$(dirname $$mod) && go mod verify -go=$$(grep -E "^go\s+\d\.\d+$$" go.mod | sed 's/^go //') | sed 's/^/ /g' \ ) || exit 1; \ done