Skip to content

Commit 779358d

Browse files
mdboothlentzi90
authored andcommitted
Download golangci-lint instead of building it
Works round some go mod dependency issues upgrading to v1.51.1, and is in line with what CAPI does.
1 parent 27a0293 commit 779358d

File tree

5 files changed

+439
-888
lines changed

5 files changed

+439
-888
lines changed

hack/tools/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
ROOT_DIR_RELATIVE := ../..
1616
include $(ROOT_DIR_RELATIVE)/common.mk
1717

18+
GOLANGCI_LINT_VERSION := v1.51.1
19+
1820
UNAME := $(shell uname -s)
1921

2022
# Directories.
@@ -98,8 +100,8 @@ $(GOJQ): $(BIN_DIR) go.mod go.sum
98100
go build -tags=tools -o $@ github.com/itchyny/gojq/cmd/gojq
99101

100102
GOLANGCI_LINT := $(BIN_DIR)/golangci-lint
101-
$(GOLANGCI_LINT): $(BIN_DIR) go.mod go.sum # Build golangci-lint from tools folder.
102-
go build -tags=tools -o $@ github.com/golangci/golangci-lint/cmd/golangci-lint
103+
$(GOLANGCI_LINT): Makefile ensure-golangci-lint.sh | $(BIN_DIR)
104+
./ensure-golangci-lint.sh -b $(BIN_DIR) $(GOLANGCI_LINT_VERSION)
103105

104106
KUSTOMIZE := $(BIN_DIR)/kustomize
105107
$(KUSTOMIZE): $(BIN_DIR) go.mod go.sum # Build kustomize from tools folder.

0 commit comments

Comments
 (0)