Skip to content

Commit

Permalink
Use existing go version in go mod tidy and verify
Browse files Browse the repository at this point in the history
This change ensures that running make mod-tidy doesn't update the
go version specified in the mod files.

Signed-off-by: Evan Lezar <[email protected]>
  • Loading branch information
elezar committed Nov 25, 2024
1 parent 43e3378 commit a81fdad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a81fdad

Please sign in to comment.