Skip to content

Commit 44bd866

Browse files
committed
Explicitly set GOROOT on lint, see golangci-lint/issues/3107
golangci/golangci-lint#3107
1 parent 4f99246 commit 44bd866

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Makefile

+6-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ build-cadctl: check-go121-install ## Build the cadctl binary
4747
lint-cadctl: install-linter ## Lint cadctl subproject
4848
@echo
4949
@echo "Linting cadctl..."
50-
GOLANGCI_LINT_CACHE=$$(mktemp -d) $(GOPATH)/bin/golangci-lint run -c .golangci.yml
50+
# Explicitly set GOROOT, see https://github.com/golangci/golangci-lint/issues/3107
51+
GOROOT=/usr/lib/golang GOLANGCI_LINT_CACHE=$$(mktemp -d) $(GOPATH)/bin/golangci-lint run -c .golangci.yml
5152

5253
.PHONY: test-cadctl
5354
test-cadctl: check-go121-install ## Run automated tests for cadctl
@@ -69,7 +70,8 @@ build-interceptor: check-go121-install ## Build the interceptor binary
6970
lint-interceptor: install-linter ## Lint interceptor subproject
7071
@echo
7172
@echo "Linting interceptor..."
72-
cd interceptor && GOLANGCI_LINT_CACHE=$$(mktemp -d) $(GOPATH)/bin/golangci-lint run -c ../.golangci.yml
73+
# Explicitly set GOROOT, see https://github.com/golangci/golangci-lint/issues/3107
74+
cd interceptor && GOROOT=/usr/lib/golang GOLANGCI_LINT_CACHE=$$(mktemp -d) $(GOPATH)/bin/golangci-lint run -c ../.golangci.yml
7375

7476
.PHONY: test-interceptor
7577
test-interceptor: check-go121-install check-jq-install build-interceptor ## Run unit tests for interceptor
@@ -102,7 +104,8 @@ build-template-updater: ## Build the template-updater binary
102104
lint-template-updater: install-linter ## Lint template-updater subproject
103105
@echo
104106
@echo "Linting template-updater..."
105-
cd hack/update-template && GOLANGCI_LINT_CACHE=$$(mktemp -d) $(GOPATH)/bin/golangci-lint run -c ../../.golangci.yml
107+
# Explicitly set GOROOT, see https://github.com/golangci/golangci-lint/issues/3107
108+
cd hack/update-template && GOROOT=/usr/lib/golang GOLANGCI_LINT_CACHE=$$(mktemp -d) $(GOPATH)/bin/golangci-lint run -c ../../.golangci.yml
106109

107110
.PHONY: boilerplate-update
108111
boilerplate-update: ## Update boilerplate version

0 commit comments

Comments
 (0)