chore(build): run golangci-lint via go run (#39907)

`make lint-go` ran `go install` and then a bare `golangci-lint` from
`PATH`, which fails when `GOBIN` is not in `PATH` and overwrites any
`golangci-lint` installed there. It now uses `go run -exec 'env
GOOS=<target>'`, which builds golangci-lint for the host and passes the
lint target `GOOS` only to golangci-lint.

`deps-tools` prebuilds the tools with `go run -exec true` instead of `go
install`, because `go install` does not fill the executable cache that
`go run` uses.

Also drops the unused `TAGS` env and the redundant OS name in
`--build-tags`.
This commit is contained in:
silverwind authored and GitHub committed 2026-10-21 05:30:19 +00:00
1 parent ecae91132b
commit 3648598d7d
2 files changed
+20 -25

No files matched your search

+8 -8
View File
@@ -561,14 +561,14 @@ deps-backend: ## install backend dependencies
$(GO) mod download
.PHONY: deps-tools
deps-tools: ## install tool dependencies
$(GO) install $(AIR_PACKAGE) & \
$(GO) install $(EDITORCONFIG_CHECKER_PACKAGE) & \
$(GO) install $(GOLANGCI_LINT_PACKAGE) & \
$(GO) install $(GXZ_PACKAGE) & \
$(GO) install $(SWAGGER_PACKAGE) & \
$(GO) install $(GOVULNCHECK_PACKAGE) & \
$(GO) install $(ACTIONLINT_PACKAGE) & \
deps-tools: ## fetch and compile tool dependencies
$(GO) run -exec true $(AIR_PACKAGE) & \
$(GO) run -exec true $(EDITORCONFIG_CHECKER_PACKAGE) & \
$(GO) run -exec true $(GOLANGCI_LINT_PACKAGE) & \
$(GO) run -exec true $(GXZ_PACKAGE) & \
$(GO) run -exec true $(SWAGGER_PACKAGE) & \
$(GO) run -exec true $(GOVULNCHECK_PACKAGE) & \
$(GO) run -exec true $(ACTIONLINT_PACKAGE) & \
wait
node_modules: pnpm-lock.yaml