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
4 changes: 4 additions & 0 deletions make/go/bootstrap.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ endef
define _conditional_include
$(if $(filter $(1),$(MAKEFILE_LIST)),,$(eval include $(1)))
endef
# Extracts the major.minor (e.g. 1.26) from a dotted version string (e.g. 1.26.3).
define _major_minor
$(word 1,$(subst ., ,$(1))).$(word 2,$(subst ., ,$(1)))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit spacing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean adding a tab at the beginning of the line? If so that would require each call site to trim whitespace when using it.

endef
2 changes: 1 addition & 1 deletion make/go/dep_bufstyle.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $(call _assert_var,BUF_VERSION)

# We want to ensure we rebuild bufstyle every time we require a new Go minor version.
# Otherwise, the cached version may not support the latest language features.
BUFSTYLE_GO_VERSION := $(shell go list -m -f '{{.GoVersion}}' | cut -d'.' -f1-2)
BUFSTYLE_GO_VERSION := $(call _major_minor,$(shell go list -m -f '{{.GoVersion}}'))

# Settable
# https://github.com/bufbuild/bufstyle-go/releases
Expand Down
4 changes: 2 additions & 2 deletions make/go/dep_godoclint.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ $(call _assert_var,BUF_VERSION)
# Otherwise, the cached version may not support the latest language features.
# 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)
GODOCLINT_GOTOOLCHAIN_VERSION := $(patsubst go%,%,$(shell go env GOVERSION))
GODOCLINT_GO_VERSION := $(call _major_minor,$(GODOCLINT_GOTOOLCHAIN_VERSION))

# Settable
#
Expand Down
4 changes: 2 additions & 2 deletions make/go/dep_govulncheck.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ $(call _assert_var,CACHE_BIN)
# Otherwise, the cached version may not support the latest language features.
# 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)
GOVULNCHECK_GOTOOLCHAIN_VERSION := $(patsubst go%,%,$(shell go env GOVERSION))
GOVULNCHECK_GO_VERSION := $(call _major_minor,$(GOVULNCHECK_GOTOOLCHAIN_VERSION))

# Settable
# https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck 20260410 checked 20260422
Expand Down
Loading