Skip to content

Commit e9c3182

Browse files
committed
update make file set golangci-lint version
1 parent 07113ca commit e9c3182

3 files changed

Lines changed: 18 additions & 157 deletions

File tree

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,16 @@ install-docker-buildx: ## Create `docker buildx` builder.
256256
echo "Buildx builder $(BUILDX_BUILDER) already exists"; \
257257
fi
258258

259+
GOLANGCILINT_VERSION ?= v2.8.0
260+
GOLANGCILINT_EXPECTED_VERSION = $(patsubst v%,%,$(GOLANGCILINT_VERSION))
261+
GOLANGCILINT_GOBIN_VERSION = $(shell [ -x "$(GOBIN)/golangci-lint" ] && $(GOBIN)/golangci-lint version 2>/dev/null | sed -n 's/.*version \([0-9.]*\).*/\1/p' | head -1)
262+
259263
.PHONY: golangci
260-
golangci: GOLANGCILINT_VERSION = v2.8.0
261264
golangci: ## Download golangci-lint locally if necessary.
262-
ifeq ($(shell golangci-lint version >/dev/null 2>&1 && echo ok),ok)
263-
@echo golangci-lint is already installed
264-
GOLANGCILINT=$(shell which golangci-lint)
265-
else ifeq (, $(shell which $(GOBIN)/golangci-lint))
265+
ifeq ($(GOLANGCILINT_EXPECTED_VERSION),$(GOLANGCILINT_GOBIN_VERSION))
266+
@echo golangci-lint $(GOLANGCILINT_VERSION) is already installed
267+
GOLANGCILINT=$(GOBIN)/golangci-lint
268+
else
266269
@{ \
267270
set -e ;\
268271
echo 'installing golangci-lint-$(GOLANGCILINT_VERSION)' ;\
@@ -273,9 +276,6 @@ else ifeq (, $(shell which $(GOBIN)/golangci-lint))
273276
echo 'Successfully installed' ;\
274277
}
275278
GOLANGCILINT=$(GOBIN)/golangci-lint
276-
else
277-
@echo golangci-lint is already installed
278-
GOLANGCILINT=$(GOBIN)/golangci-lint
279279
endif
280280

281281
.PHONY: staticchecktool

go.mod

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ require (
6161
golang.org/x/mod v0.35.0
6262
golang.org/x/net v0.53.0
6363
golang.org/x/sync v0.20.0
64+
golang.org/x/text v0.36.0
6465
gopkg.in/yaml.v2 v2.4.0
6566
helm.sh/helm/v3 v3.18.5
6667
k8s.io/api v0.33.3
@@ -94,7 +95,6 @@ require (
9495
dario.cat/mergo v1.0.2 // indirect
9596
filippo.io/edwards25519 v1.1.1 // indirect
9697
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 // indirect
97-
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 // indirect
9898
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
9999
github.com/BurntSushi/toml v1.5.0 // indirect
100100
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 // indirect
@@ -112,7 +112,6 @@ require (
112112
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
113113
github.com/andybalholm/brotli v1.0.5 // indirect
114114
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect
115-
github.com/aws/aws-sdk-go v1.55.5 // indirect
116115
github.com/aws/aws-sdk-go-v2 v1.41.4 // indirect
117116
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.7 // indirect
118117
github.com/aws/aws-sdk-go-v2/config v1.32.12 // indirect
@@ -151,14 +150,10 @@ require (
151150
github.com/cockroachdb/apd/v3 v3.2.1 // indirect
152151
github.com/containerd/cgroups/v3 v3.0.5 // indirect
153152
github.com/containerd/containerd v1.7.32 // indirect
154-
github.com/containerd/containerd/api v1.8.0 // indirect
155-
github.com/containerd/continuity v0.4.4 // indirect
156153
github.com/containerd/errdefs v1.0.0 // indirect
157154
github.com/containerd/errdefs/pkg v0.3.0 // indirect
158-
github.com/containerd/fifo v1.1.0 // indirect
159155
github.com/containerd/log v0.1.0 // indirect
160156
github.com/containerd/platforms v0.2.1 // indirect
161-
github.com/containerd/ttrpc v1.2.7 // indirect
162157
github.com/containerd/typeurl/v2 v2.2.3 // indirect
163158
github.com/containers/image/v5 v5.36.2 // indirect
164159
github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 // indirect
@@ -180,7 +175,6 @@ require (
180175
github.com/docker/distribution v2.8.3+incompatible // indirect
181176
github.com/docker/docker v28.4.0+incompatible // indirect
182177
github.com/docker/docker-credential-helpers v0.9.3 // indirect
183-
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
184178
github.com/docker/go-metrics v0.0.1 // indirect
185179
github.com/docker/go-units v0.5.0 // indirect
186180
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
@@ -242,7 +236,6 @@ require (
242236
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
243237
github.com/hashicorp/go-getter v1.8.6 // indirect
244238
github.com/hashicorp/go-multierror v1.1.1 // indirect
245-
github.com/hashicorp/go-safetemp v1.0.0 // indirect
246239
github.com/hashicorp/hcl v1.0.1-vault-5 // indirect
247240
github.com/hashicorp/terraform-json v0.15.0 // indirect
248241
github.com/huandu/xstrings v1.5.0 // indirect
@@ -254,7 +247,6 @@ require (
254247
github.com/jackc/puddle/v2 v2.2.2 // indirect
255248
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
256249
github.com/jinzhu/copier v0.4.0 // indirect
257-
github.com/jmespath/go-jmespath v0.4.0 // indirect
258250
github.com/jmoiron/sqlx v1.4.0 // indirect
259251
github.com/jonboulle/clockwork v0.3.0 // indirect
260252
github.com/josharian/intern v1.0.0 // indirect
@@ -293,7 +285,6 @@ require (
293285
github.com/moby/sys/capability v0.4.0 // indirect
294286
github.com/moby/sys/mountinfo v0.7.2 // indirect
295287
github.com/moby/sys/sequential v0.6.0 // indirect
296-
github.com/moby/sys/signal v0.7.0 // indirect
297288
github.com/moby/sys/user v0.4.0 // indirect
298289
github.com/moby/sys/userns v0.1.0 // indirect
299290
github.com/moby/term v0.5.2 // indirect
@@ -387,7 +378,6 @@ require (
387378
golang.org/x/oauth2 v0.36.0 // indirect
388379
golang.org/x/sys v0.43.0 // indirect
389380
golang.org/x/term v0.42.0 // indirect
390-
golang.org/x/text v0.36.0 // indirect
391381
golang.org/x/time v0.15.0 // indirect
392382
golang.org/x/tools v0.44.0 // indirect
393383
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect

0 commit comments

Comments
 (0)