Skip to content

Commit 082b447

Browse files
committed
chore: Upgrade golangci-lint to 2.4.0
1 parent 324f3d9 commit 082b447

39 files changed

+218
-146
lines changed

.github/workflows/darwin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Set up Go 1.x
1414
uses: actions/setup-go@v5
1515
with:
16-
go-version: ^1.16
16+
go-version: ^1.25
1717
id: go
1818

1919
- name: Check out code into the Go module directory

.github/workflows/linux.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Set up Go 1.x
1414
uses: actions/setup-go@v5
1515
with:
16-
go-version: ^1.16
16+
go-version: ^1.25
1717
id: go
1818

1919
- name: Check out code into the Go module directory

.github/workflows/static.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
- name: Set up Go 1.x
1111
uses: actions/setup-go@v5
1212
with:
13-
go-version: ^1.19
13+
go-version: ^1.25
1414
- uses: actions/checkout@master
1515
- name: Run linter
16-
uses: golangci/golangci-lint-action@v6
16+
uses: golangci/golangci-lint-action@v8
1717
with:
18-
version: v1.64
19-
args: -E=gofmt,unused,ineffassign,revive,misspell,copyloopvar,asciicheck,bodyclose,contextcheck,dogsled,durationcheck,errname,forbidigo -D=staticcheck --timeout=30m0s
18+
version: v2.4.0
19+
args: --timeout=30m0s

.github/workflows/trivy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Set up Go 1.x
1313
uses: actions/setup-go@v5
1414
with:
15-
go-version: 1.24.6
15+
go-version: 1.25
1616
id: go
1717

1818
- name: Checkout code

.github/workflows/ubuntu-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Go 1.x
1717
uses: actions/setup-go@v5
1818
with:
19-
go-version: ^1.16
19+
go-version: ^1.25
2020
id: go
2121

2222
- name: Check out code into the Go module directory

.github/workflows/windows.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Set up Go 1.x
1515
uses: actions/setup-go@v5
1616
with:
17-
go-version: ^1.16
17+
go-version: ^1.25
1818
id: go
1919
- name: Checkout code
2020
uses: actions/checkout@v5

.golangci.yml

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,40 @@
1-
linters-settings:
2-
depguard:
3-
rules:
4-
main:
5-
files:
6-
- $all
7-
- "!$test"
8-
allow:
9-
- $gostd
10-
- k8s.io
11-
- sigs.k8s.io
12-
- github.com
1+
version: "2"
2+
3+
linters:
4+
settings:
5+
depguard:
6+
rules:
7+
main:
8+
files:
9+
- $all
10+
- '!$test'
11+
allow:
12+
- $gostd
13+
- k8s.io
14+
- sigs.k8s.io
15+
- github.com
16+
exclusions:
17+
generated: lax
18+
presets:
19+
- comments
20+
- common-false-positives
21+
- legacy
22+
- std-error-handling
23+
paths:
24+
- third_party$
25+
- builtin$
26+
- examples$
27+
- test/utils/azure/azure_helpers.go
28+
- vendor$
29+
formatters:
30+
enable:
31+
- gofmt
32+
- goimports
33+
- gofumpt
34+
exclusions:
35+
generated: lax
36+
paths:
37+
- third_party$
38+
- builtin$
39+
- examples$
40+
- vendor$

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/kubernetes-csi/csi-driver-smb
22

3-
go 1.24
3+
go 1.25
44

55
godebug winsymlink=0
66

pkg/csi-common/driver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func NewCSIDriver(name string, v string, nodeID string) *CSIDriver {
4848
// TODO version format and validation
4949
if len(v) == 0 {
5050
klog.Errorf("Version argument missing, now skip it")
51-
//return nil
51+
// return nil
5252
}
5353

5454
driver := CSIDriver{

pkg/csi-common/driver_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,9 @@ const (
3131
fakeNodeID = "fakeNodeID"
3232
)
3333

34-
var (
35-
vendorVersion = "0.3.0"
36-
)
34+
var vendorVersion = "0.3.0"
3735

3836
func NewFakeDriver() *CSIDriver {
39-
4037
driver := NewCSIDriver(fakeDriverName, vendorVersion, fakeNodeID)
4138

4239
return driver
@@ -102,7 +99,6 @@ func TestNewCSIDriver(t *testing.T) {
10299
}
103100

104101
func TestGetVolumeCapabilityAccessModes(t *testing.T) {
105-
106102
d := NewFakeDriver()
107103

108104
// Test no volume access modes.
@@ -159,7 +155,6 @@ func TestValidateControllerServiceRequest(t *testing.T) {
159155
// Test controller service clone volumes is supported
160156
err = d.ValidateControllerServiceRequest(csi.ControllerServiceCapability_RPC_CLONE_VOLUME)
161157
assert.NoError(t, err)
162-
163158
}
164159

165160
func TestValidateNodeServiceRequest(t *testing.T) {

0 commit comments

Comments
 (0)