Skip to content

Commit 918a23f

Browse files
committed
chore: Upgrade golangci-lint version
- Upgrades golangci-ling to v1.64.5 - Fixes The linter 'exportloopref' is deprecated (since v1.60.2) due to: Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar. - Fixes unused-parameter linter warnings - Fixes redefined builtin cap linter warnings Signed-off-by: Raymond Etornam <[email protected]>
1 parent 7ab3b3f commit 918a23f

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

.github/workflows/static.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ jobs:
1515
- name: Run linter
1616
uses: golangci/golangci-lint-action@v6
1717
with:
18-
version: v1.60
19-
args: -E=gofmt,unused,ineffassign,revive,misspell,exportloopref,asciicheck,bodyclose,contextcheck,depguard,dogsled,durationcheck,errname,forbidigo -D=staticcheck --timeout=30m0s
18+
version: v1.64.5
19+
args: -E=gofmt,unused,ineffassign,revive,misspell,copyloopvar,asciicheck,bodyclose,contextcheck,depguard,dogsled,durationcheck,errname,forbidigo -D=staticcheck --timeout=30m0s

pkg/csi-common/utils.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,21 @@ func NewVolumeCapabilityAccessMode(mode csi.VolumeCapability_AccessMode_Mode) *c
4242
return &csi.VolumeCapability_AccessMode{Mode: mode}
4343
}
4444

45-
func NewControllerServiceCapability(cap csi.ControllerServiceCapability_RPC_Type) *csi.ControllerServiceCapability {
45+
func NewControllerServiceCapability(capability csi.ControllerServiceCapability_RPC_Type) *csi.ControllerServiceCapability {
4646
return &csi.ControllerServiceCapability{
4747
Type: &csi.ControllerServiceCapability_Rpc{
4848
Rpc: &csi.ControllerServiceCapability_RPC{
49-
Type: cap,
49+
Type: capability,
5050
},
5151
},
5252
}
5353
}
5454

55-
func NewNodeServiceCapability(cap csi.NodeServiceCapability_RPC_Type) *csi.NodeServiceCapability {
55+
func NewNodeServiceCapability(capability csi.NodeServiceCapability_RPC_Type) *csi.NodeServiceCapability {
5656
return &csi.NodeServiceCapability{
5757
Type: &csi.NodeServiceCapability_Rpc{
5858
Rpc: &csi.NodeServiceCapability_RPC{
59-
Type: cap,
59+
Type: capability,
6060
},
6161
},
6262
}

pkg/smb/controllerserver_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ func TestCreateVolume(t *testing.T) {
181181
}
182182

183183
for _, test := range cases {
184-
test := test //pin
185184
t.Run(test.name, func(t *testing.T) {
186185
if test.skipOnWindows && runtime.GOOS == "windows" {
187186
return
@@ -265,7 +264,6 @@ func TestDeleteVolume(t *testing.T) {
265264
},
266265
}
267266
for _, test := range cases {
268-
test := test //pin
269267
t.Run(test.desc, func(t *testing.T) {
270268
// Setup
271269
_ = os.MkdirAll(filepath.Join(d.workingMountDir, testCSIVolume), os.ModePerm)
@@ -562,7 +560,6 @@ func TestGetSmbVolFromID(t *testing.T) {
562560
},
563561
}
564562
for _, test := range cases {
565-
test := test //pin
566563
t.Run(test.desc, func(t *testing.T) {
567564
smbVolume, err := getSmbVolFromID(test.volumeID)
568565

pkg/smb/smb_common_darwin.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ import (
2626
)
2727

2828
func Mount(m *mount.SafeFormatAndMount, source, target, fsType string, options []string, sensitiveMountOptions []string, volumeID string) error {
29+
_ = volumeID
2930
return m.MountSensitive(source, target, fsType, options, sensitiveMountOptions)
3031
}
3132

3233
func CleanupSMBMountPoint(m *mount.SafeFormatAndMount, target string, extensiveMountCheck bool, volumeID string) error {
34+
_ = volumeID
3335
return mount.CleanupMountPoint(target, m, extensiveMountCheck)
3436
}
3537

@@ -38,13 +40,18 @@ func CleanupMountPoint(m *mount.SafeFormatAndMount, target string, extensiveMoun
3840
}
3941

4042
func preparePublishPath(path string, m *mount.SafeFormatAndMount) error {
43+
_ = path
44+
_ = m
4145
return nil
4246
}
4347

4448
func prepareStagePath(path string, m *mount.SafeFormatAndMount) error {
49+
_ = path
50+
_ = m
4551
return nil
4652
}
4753

4854
func Mkdir(m *mount.SafeFormatAndMount, name string, perm os.FileMode) error {
55+
_ = m // fixes linting
4956
return os.Mkdir(name, perm)
5057
}

0 commit comments

Comments
 (0)