Skip to content

Commit 6fe1f6a

Browse files
authored
update linter 1.62.2 (#10)
* update linter 1.62.2
1 parent b8ea7b2 commit 6fe1f6a

File tree

8 files changed

+61
-56
lines changed

8 files changed

+61
-56
lines changed

.github/workflows/test.yaml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,19 @@ jobs:
1010
test:
1111
strategy:
1212
matrix:
13-
go-version: [1.22.x]
13+
go-version: [1.23.x]
1414
platform: [ubuntu-latest]
1515
runs-on: ${{ matrix.platform }}
1616
steps:
1717
- name: Install Go
18-
uses: actions/setup-go@v3
18+
uses: actions/setup-go@v5
1919
with:
2020
go-version: ${{ matrix.go-version }}
21+
check-latest: true
22+
cache: true
2123
- name: Checkout code
22-
uses: actions/checkout@v3
23-
- uses: actions/cache@v3
24+
uses: actions/checkout@v4
25+
- uses: actions/cache@v4
2426
with:
2527
path: ~/go/pkg/mod
2628
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
@@ -32,33 +34,35 @@ jobs:
3234
lint:
3335
strategy:
3436
matrix:
35-
go-version: [1.22.x]
37+
go-version: [1.23.x]
3638
platform: [ubuntu-latest]
3739
runs-on: ${{ matrix.platform }}
3840
steps:
3941
- name: Checkout code
40-
uses: actions/checkout@v3
42+
uses: actions/checkout@v4
4143
- name: golangci-lint
42-
uses: golangci/golangci-lint-action@v3
44+
uses: golangci/golangci-lint-action@v6.1.1
4345
with:
44-
version: v1.59.1
46+
version: v1.62.2
4547
args: -v --config config/.golangci-no-plugin.yml
4648
lint-plugin:
4749
strategy:
4850
matrix:
49-
go: [1.22.x]
51+
go: [1.23.x]
5052
os: [ubuntu-latest]
5153
name: lint-plugin
5254
runs-on: ${{ matrix.os }}
5355
steps:
54-
- uses: actions/setup-go@v3
56+
- uses: actions/setup-go@v5
5557
with:
5658
go-version: ${{ matrix.go }}
57-
- uses: actions/checkout@v3
59+
check-latest: true
60+
cache: true
61+
- uses: actions/checkout@v4
5862
name: Checkout code
5963
- name: Install golangci-lint
6064
run: |
61-
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1
65+
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
6266
- name: Build plugin
6367
run: |
6468
go build --buildmode plugin -o cerrl.so plugin/cerrl.go
@@ -71,19 +75,21 @@ jobs:
7175
# lint-plugin:
7276
# strategy:
7377
# matrix:
74-
# go: [1.22.x]
78+
# go: [1.23.x]
7579
# os: [ubuntu-latest]
7680
# name: lint-plugin
7781
# runs-on: ${{ matrix.os }}
7882
# steps:
79-
# - uses: actions/setup-go@v3
83+
# - uses: actions/setup-go@v5
8084
# with:
8185
# go-version: ${{ matrix.go }}
82-
# - uses: actions/checkout@v3
86+
# check-latest: true
87+
# cache: true
88+
# - uses: actions/checkout@v4
8389
# name: Checkout code
8490
# - name: Install golangci-lint
8591
# run: |
86-
# go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1
92+
# go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
8793
# - name: Build plugin
8894
# run: |
8995
# curl -L -o go-lint-cerrl.zip https://github.com/edenlabllc/go-lint-cerrl/archive/refs/tags/v0.1.0.zip

config/.golangci-no-plugin.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,14 @@ linters-settings:
4343
local-prefixes: github.com/golangci/golangci-lint
4444
golint:
4545
min-confidence: 0
46-
gomnd:
47-
settings:
48-
mnd:
49-
# don't include the "operation" and "assign"
50-
checks:
51-
- argument
52-
- case
53-
- condition
54-
- return
46+
mnd:
47+
checks:
48+
- argument
49+
- case
50+
- condition
51+
- return
5552
govet:
56-
check-shadowing: true
53+
shadow: true
5754
lll:
5855
line-length: 140
5956
maligned:
@@ -153,7 +150,7 @@ linters:
153150
- gofmt
154151
- goimports
155152
- revive
156-
- gomnd
153+
- mnd
157154
- goprintffuncname
158155
- gosec
159156
- gosimple
@@ -163,7 +160,7 @@ linters:
163160
- misspell
164161
- nakedret
165162
- nolintlint
166-
- exportloopref
163+
- copyloopvar
167164
- staticcheck
168165
- stylecheck
169166
- typecheck
@@ -199,4 +196,4 @@ issues:
199196
text: "unnecessaryDefer:"
200197
run:
201198
timeout: 10m
202-
go: '1.22'
199+
go: '1.23'

config/.golangci-plugin-only.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ issues:
2020

2121
run:
2222
timeout: 10m
23-
go: '1.20'
23+
go: '1.23'

config/.golangci.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,14 @@ linters-settings:
4747
local-prefixes: github.com/golangci/golangci-lint
4848
golint:
4949
min-confidence: 0
50-
gomnd:
51-
settings:
52-
mnd:
53-
# don't include the "operation" and "assign"
54-
checks:
55-
- argument
56-
- case
57-
- condition
58-
- return
50+
mnd:
51+
checks:
52+
- argument
53+
- case
54+
- condition
55+
- return
5956
govet:
60-
check-shadowing: true
57+
shadow: true
6158
lll:
6259
line-length: 140
6360
maligned:
@@ -158,7 +155,7 @@ linters:
158155
- gofmt
159156
- goimports
160157
- revive
161-
- gomnd
158+
- mnd
162159
- goprintffuncname
163160
- gosec
164161
- gosimple
@@ -168,7 +165,7 @@ linters:
168165
- misspell
169166
- nakedret
170167
- nolintlint
171-
- exportloopref
168+
- copyloopvar
172169
- staticcheck
173170
- stylecheck
174171
- typecheck
@@ -206,4 +203,4 @@ issues:
206203

207204
run:
208205
timeout: 10m
209-
go: '1.22'
206+
go: '1.23'

docker/docker-compose-lint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22

33
cd /app
44

5-
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1
5+
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
66

77
go build --buildmode plugin -o /tmp/cerrl.so plugin/cerrl.go
88

99
cat config/.golangci.yml | sed "s/path: ..\/cerrl.so/path: \/tmp\/cerrl.so/g" > /tmp/.golangci.yml
1010

11+
# To get the version of a specific library
12+
golangci-lint version --debug | grep "golang.org/x/tools"
13+
1114
golangci-lint run -v --config /tmp/.golangci.yml
1215

13-
rm /tmp/cerrl.so
16+
rm /tmp/cerrl.so

docker/docker-compose-lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3.7'
22

33
services:
44
golangci-lint-docker-compose:
5-
image: golang:1.22
5+
image: golang:1.23
66
container_name: golangci-lint-docker-compose
77
volumes:
88
- ..:/app

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module github.com/edenlabllc/go-lint-cerrl
22

3-
go 1.22
3+
go 1.23
44

5-
require golang.org/x/tools v0.22.0
5+
require golang.org/x/tools v0.27.0
66

77
require (
8-
golang.org/x/mod v0.18.0 // indirect
9-
golang.org/x/sync v0.7.0 // indirect
8+
golang.org/x/mod v0.22.0 // indirect
9+
golang.org/x/sync v0.10.0 // indirect
1010
)

go.sum

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
2-
golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
3-
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
4-
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
5-
golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
6-
golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c=
1+
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
2+
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
3+
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
4+
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
5+
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
6+
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
7+
golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o=
8+
golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q=

0 commit comments

Comments
 (0)