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) <noreply@anthropic.com>
This commit is contained in:
Stefan Haller 2026-07-02 09:34:50 +02:00
parent 8af6104454
commit 4b082ed096
3 changed files with 3 additions and 3 deletions

View file

@ -70,4 +70,4 @@ record-demo:
.PHONY: vendor
vendor:
go mod vendor && go mod tidy
go mod tidy && go mod vendor

View file

@ -75,4 +75,4 @@ demo *args:
demo/record_demo.sh {{ args }}
vendor:
go mod vendor && go mod tidy
go mod tidy && go mod vendor

View file

@ -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)