Skip to content

Commit ca02865

Browse files
Upgrade golangci-lint from v1.59 to v1.61 and resolve new lint issues
- Upgraded golangci-lint from v1.59 to v1.61. - Fixed issues flagged by new lint rules in v1.61: - Resolved `comment-spacings` errors in api.go by adding spaces after `//` delimiters. - Addressed `govet` error by formatting non-constant strings in `fmt.Errorf`. - Updated `staticcheck` issues in resource.go by replacing `fmt.Errorf` with `errors.New` for static error messages. - Deprecated the `exportloopref` linter, replaced by `copyloopvar` for Go 1.22+.
1 parent f3de87c commit ca02865

File tree

28 files changed

+35
-34
lines changed

28 files changed

+35
-34
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Run linter
2525
uses: golangci/golangci-lint-action@v6
2626
with:
27-
version: v1.59
27+
version: v1.61
2828

2929
yamllint:
3030
runs-on: ubuntu-latest

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ linters:
6868
enable:
6969
- dupl
7070
- errcheck
71-
- exportloopref
71+
- copyloopvar
7272
- ginkgolinter
7373
- goconst
7474
- gocyclo

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
104104
golangci-lint:
105105
@[ -f $(GOLANGCI_LINT) ] || { \
106106
set -e ;\
107-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.59.1 ;\
107+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.61.0 ;\
108108
}
109109

110110
.PHONY: apidiff

docs/book/src/cronjob-tutorial/testdata/project/.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- name: Run linter
2121
uses: golangci/golangci-lint-action@v6
2222
with:
23-
version: v1.59
23+
version: v1.61

docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ linters:
2121
enable:
2222
- dupl
2323
- errcheck
24-
- exportloopref
24+
- copyloopvar
2525
- ginkgolinter
2626
- goconst
2727
- gocyclo

docs/book/src/cronjob-tutorial/testdata/project/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ GOLANGCI_LINT = $(LOCALBIN)/golangci-lint
177177
KUSTOMIZE_VERSION ?= v5.5.0
178178
CONTROLLER_TOOLS_VERSION ?= v0.16.4
179179
ENVTEST_VERSION ?= release-0.19
180-
GOLANGCI_LINT_VERSION ?= v1.59.1
180+
GOLANGCI_LINT_VERSION ?= v1.61.0
181181

182182
.PHONY: kustomize
183183
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.

docs/book/src/getting-started/testdata/project/.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- name: Run linter
2121
uses: golangci/golangci-lint-action@v6
2222
with:
23-
version: v1.59
23+
version: v1.61

docs/book/src/getting-started/testdata/project/.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ linters:
2121
enable:
2222
- dupl
2323
- errcheck
24-
- exportloopref
24+
- copyloopvar
2525
- ginkgolinter
2626
- goconst
2727
- gocyclo

docs/book/src/getting-started/testdata/project/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ GOLANGCI_LINT = $(LOCALBIN)/golangci-lint
173173
KUSTOMIZE_VERSION ?= v5.5.0
174174
CONTROLLER_TOOLS_VERSION ?= v0.16.4
175175
ENVTEST_VERSION ?= release-0.19
176-
GOLANGCI_LINT_VERSION ?= v1.59.1
176+
GOLANGCI_LINT_VERSION ?= v1.61.0
177177

178178
.PHONY: kustomize
179179
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.

docs/book/src/multiversion-tutorial/testdata/project/.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- name: Run linter
2121
uses: golangci/golangci-lint-action@v6
2222
with:
23-
version: v1.59
23+
version: v1.61

0 commit comments

Comments
 (0)