Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions make/go/dep_godoclint.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ $(call _assert_var,BUF_VERSION)

# We want to ensure we rebuild godoclint every time we require a new Go minor version.
# Otherwise, the cached version may not support the latest language features.
GODOCLINT_GO_VERSION := $(shell go list -m -f '{{.GoVersion}}' | cut -d'.' -f1-2)
# This version is the go toolchain version (which may be more specific than the module
# version) to ensure the build handles specific language features in newer toolchains.
GODOCLINT_GOTOOLCHAIN_VERSION := $(shell go env GOVERSION | sed 's/^go//')
GODOCLINT_GO_VERSION := $(shell echo $(GODOCLINT_GOTOOLCHAIN_VERSION) | cut -d'.' -f1-2)

# Settable
#
Expand All @@ -29,7 +32,7 @@ $(CACHE_VERSIONS)/godoclint/godoclint-$(GODOCLINT_VERSION)-go$(GODOCLINT_GO_VERS
git clone https://github.com/bufbuild/godoc-lint && \
cd ./godoc-lint && \
git checkout $(GODOCLINT_VERSION) && \
GOBIN=$(dir $@) go install ./cmd/godoclint
GOBIN=$(dir $@) GOTOOLCHAIN=go$(GODOCLINT_GOTOOLCHAIN_VERSION) go install ./cmd/godoclint
@rm -rf $(GODOCLINT_TMP)
@mv $(dir $@)/godoclint $@
@test -x $@
Expand Down
9 changes: 5 additions & 4 deletions make/go/dep_govulncheck.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ $(call _assert_var,CACHE_BIN)

# We want to ensure we rebuild govulncheck every time we require a new Go minor version.
# Otherwise, the cached version may not support the latest language features.
# This version is the go toolchain version not the module version to ensure
# the build handles specific language features in newer toolchains.
GOVULNCHECK_GO_VERSION := $(shell go env GOVERSION | sed 's/^go//' | cut -d'.' -f1-2)
# This version is the go toolchain version (which may be more specific than the module
# version) to ensure the build handles specific language features in newer toolchains.
GOVULNCHECK_GOTOOLCHAIN_VERSION := $(shell go env GOVERSION | sed 's/^go//')
GOVULNCHECK_GO_VERSION := $(shell echo $(GOVULNCHECK_GOTOOLCHAIN_VERSION) | cut -d'.' -f1-2)

# Settable
# https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck 20250106 checked 20250212
Expand All @@ -22,7 +23,7 @@ $(CACHE_VERSIONS)/govulncheck/govulncheck-$(GOVULNCHECK_VERSION)-go$(GOVULNCHECK
@rm -f $(GOVULNCHECK)
@rm -rf $(dir $@)
@mkdir -p $(dir $@)
GOBIN=$(dir $@) go install golang.org/x/vuln/cmd/govulncheck@$(GOVULNCHECK_VERSION)
GOBIN=$(dir $@) GOTOOLCHAIN=go$(GOVULNCHECK_GOTOOLCHAIN_VERSION) go install golang.org/x/vuln/cmd/govulncheck@$(GOVULNCHECK_VERSION)
@mv $(dir $@)/govulncheck $@
@test -x $@
@touch $@
Expand Down