Skip to content

Commit 7023cca

Browse files
authored
Merge pull request #2038 from andyzhangx/fix-golint-1.24
[release-1.24] test: fix golint errors
2 parents 88818b7 + e5fb217 commit 7023cca

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
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@v4
1717
with:
18-
version: v1.60
19-
args: -E=gofmt,unused,ineffassign,revive,misspell,exportloopref,asciicheck,bodyclose,depguard,dogsled,durationcheck,errname,forbidigo -D=staticcheck --timeout=30m0s
18+
version: v1.64
19+
args: -E=gofmt,unused,ineffassign,revive,misspell,asciicheck,bodyclose,dogsled,durationcheck,errname,forbidigo -D=staticcheck --timeout=30m0s

pkg/csi-common/driver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ func (d *CSIDriver) ValidateControllerServiceRequest(c csi.ControllerServiceCapa
6565
return nil
6666
}
6767

68-
for _, cap := range d.Cap {
69-
if c == cap.GetRpc().GetType() {
68+
for _, capability := range d.Cap {
69+
if c == capability.GetRpc().GetType() {
7070
return nil
7171
}
7272
}

pkg/csi-common/utils.go

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

73-
func NewControllerServiceCapability(cap csi.ControllerServiceCapability_RPC_Type) *csi.ControllerServiceCapability {
73+
func NewControllerServiceCapability(c csi.ControllerServiceCapability_RPC_Type) *csi.ControllerServiceCapability {
7474
return &csi.ControllerServiceCapability{
7575
Type: &csi.ControllerServiceCapability_Rpc{
7676
Rpc: &csi.ControllerServiceCapability_RPC{
77-
Type: cap,
77+
Type: c,
7878
},
7979
},
8080
}
8181
}
8282

83-
func NewNodeServiceCapability(cap csi.NodeServiceCapability_RPC_Type) *csi.NodeServiceCapability {
83+
func NewNodeServiceCapability(c csi.NodeServiceCapability_RPC_Type) *csi.NodeServiceCapability {
8484
return &csi.NodeServiceCapability{
8585
Type: &csi.NodeServiceCapability_Rpc{
8686
Rpc: &csi.NodeServiceCapability_RPC{
87-
Type: cap,
87+
Type: c,
8888
},
8989
},
9090
}

pkg/csi-common/utils_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -178,53 +178,53 @@ func TestLogGRPC(t *testing.T) {
178178

179179
func TestNewControllerServiceCapability(t *testing.T) {
180180
tests := []struct {
181-
cap csi.ControllerServiceCapability_RPC_Type
181+
c csi.ControllerServiceCapability_RPC_Type
182182
}{
183183
{
184-
cap: csi.ControllerServiceCapability_RPC_UNKNOWN,
184+
c: csi.ControllerServiceCapability_RPC_UNKNOWN,
185185
},
186186
{
187-
cap: csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME,
187+
c: csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME,
188188
},
189189
{
190-
cap: csi.ControllerServiceCapability_RPC_PUBLISH_UNPUBLISH_VOLUME,
190+
c: csi.ControllerServiceCapability_RPC_PUBLISH_UNPUBLISH_VOLUME,
191191
},
192192
{
193-
cap: csi.ControllerServiceCapability_RPC_LIST_VOLUMES,
193+
c: csi.ControllerServiceCapability_RPC_LIST_VOLUMES,
194194
},
195195
{
196-
cap: csi.ControllerServiceCapability_RPC_GET_CAPACITY,
196+
c: csi.ControllerServiceCapability_RPC_GET_CAPACITY,
197197
},
198198
{
199-
cap: csi.ControllerServiceCapability_RPC_CLONE_VOLUME,
199+
c: csi.ControllerServiceCapability_RPC_CLONE_VOLUME,
200200
},
201201
}
202202
for _, test := range tests {
203-
resp := NewControllerServiceCapability(test.cap)
203+
resp := NewControllerServiceCapability(test.c)
204204
assert.NotNil(t, resp)
205205
assert.Equal(t, resp.XXX_sizecache, int32(0))
206206
}
207207
}
208208

209209
func TestNewNodeServiceCapability(t *testing.T) {
210210
tests := []struct {
211-
cap csi.NodeServiceCapability_RPC_Type
211+
c csi.NodeServiceCapability_RPC_Type
212212
}{
213213
{
214-
cap: csi.NodeServiceCapability_RPC_UNKNOWN,
214+
c: csi.NodeServiceCapability_RPC_UNKNOWN,
215215
},
216216
{
217-
cap: csi.NodeServiceCapability_RPC_STAGE_UNSTAGE_VOLUME,
217+
c: csi.NodeServiceCapability_RPC_STAGE_UNSTAGE_VOLUME,
218218
},
219219
{
220-
cap: csi.NodeServiceCapability_RPC_GET_VOLUME_STATS,
220+
c: csi.NodeServiceCapability_RPC_GET_VOLUME_STATS,
221221
},
222222
{
223-
cap: csi.NodeServiceCapability_RPC_EXPAND_VOLUME,
223+
c: csi.NodeServiceCapability_RPC_EXPAND_VOLUME,
224224
},
225225
}
226226
for _, test := range tests {
227-
resp := NewNodeServiceCapability(test.cap)
227+
resp := NewNodeServiceCapability(test.c)
228228
assert.NotNil(t, resp)
229229
assert.Equal(t, resp.XXX_sizecache, int32(0))
230230
}

0 commit comments

Comments
 (0)