From 4b082ed096d571d3640250d44b178b9f88d2eb7e Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 2 Jul 2026 09:34:50 +0200 Subject: [PATCH] Run `go mod tidy` before `go mod vendor` With the previous order, `go mod vendor` populated vendor/ from the current go.mod, and only then did `go mod tidy` prune it. If tidy changed go.mod, vendor/ was left matching the pre-tidy state, so a single run could leave vendor/modules.txt inconsistent with go.mod (it took a second run to converge). Tidying first settles go.mod/go.sum, then vendor rebuilds vendor/ to match in one pass. This applies both to the `vendor` recipe (justfile and Makefile) and to scripts/bump_lazycore.sh. Co-Authored-By: Claude Opus 4.8 (1M context) --- Makefile | 2 +- justfile | 2 +- scripts/bump_lazycore.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 10bea092a..3e56a2821 100644 --- a/Makefile +++ b/Makefile @@ -70,4 +70,4 @@ record-demo: .PHONY: vendor vendor: - go mod vendor && go mod tidy + go mod tidy && go mod vendor diff --git a/justfile b/justfile index f9351732a..64d9d1ee2 100644 --- a/justfile +++ b/justfile @@ -75,4 +75,4 @@ demo *args: demo/record_demo.sh {{ args }} vendor: - go mod vendor && go mod tidy + go mod tidy && go mod vendor diff --git a/scripts/bump_lazycore.sh b/scripts/bump_lazycore.sh index 810e5f08e..a5cfe05ff 100755 --- a/scripts/bump_lazycore.sh +++ b/scripts/bump_lazycore.sh @@ -1,5 +1,5 @@ # Go's proxy servers are not very up-to-date so that's why we use `GOPROXY=direct` # We specify the `awesome` branch to avoid the default behaviour of looking for a semver tag. -GOPROXY=direct go get -u github.com/jesseduffield/lazycore@master && go mod vendor && go mod tidy +GOPROXY=direct go get -u github.com/jesseduffield/lazycore@master && go mod tidy && go mod vendor # Note to self if you ever want to fork a repo be sure to use this same approach: it's important to use the branch name (e.g. master)