Skip to content

Commit 3f38c89

Browse files
committed
chore: fix golint
1 parent 8e3b4f8 commit 3f38c89

File tree

5 files changed

+29
-29
lines changed

5 files changed

+29
-29
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,copyloopvar,asciicheck,bodyclose,depguard,dogsled,dupl,durationcheck,errname,forbidigo -D=staticcheck --timeout=30m0s
18+
version: v1.64
19+
args: -E=gofmt,unused,ineffassign,revive,misspell,copyloopvar,asciicheck,bodyclose,dogsled,dupl,durationcheck,errname,forbidigo -D=staticcheck --timeout=30m0s

pkg/azurefile/controllerserver.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,16 +1389,16 @@ func isValidVolumeCapabilities(volCaps []*csi.VolumeCapability) error {
13891389
if len(volCaps) == 0 {
13901390
return fmt.Errorf("CreateVolume Volume capabilities must be provided")
13911391
}
1392-
hasSupport := func(cap *csi.VolumeCapability) error {
1393-
if blk := cap.GetBlock(); blk != nil {
1392+
hasSupport := func(c *csi.VolumeCapability) error {
1393+
if blk := c.GetBlock(); blk != nil {
13941394
return fmt.Errorf("driver does not support block volumes")
13951395
}
1396-
for _, c := range volumeCaps {
1397-
if c.GetMode() == cap.AccessMode.GetMode() {
1396+
for _, vc := range volumeCaps {
1397+
if vc.GetMode() == c.AccessMode.GetMode() {
13981398
return nil
13991399
}
14001400
}
1401-
return fmt.Errorf("driver does not support access mode %v", cap.AccessMode.GetMode())
1401+
return fmt.Errorf("driver does not support access mode %v", c.AccessMode.GetMode())
14021402
}
14031403

14041404
for _, c := range volCaps {

pkg/csi-common/driver.go

Lines changed: 4 additions & 4 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
}
@@ -78,8 +78,8 @@ func (d *CSIDriver) ValidateNodeServiceRequest(c csi.NodeServiceCapability_RPC_T
7878
return nil
7979
}
8080

81-
for _, cap := range d.NSCap {
82-
if c == cap.GetRpc().GetType() {
81+
for _, capability := range d.NSCap {
82+
if c == capability.GetRpc().GetType() {
8383
return nil
8484
}
8585
}

pkg/csi-common/utils.go

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

74-
func NewControllerServiceCapability(cap csi.ControllerServiceCapability_RPC_Type) *csi.ControllerServiceCapability {
74+
func NewControllerServiceCapability(c csi.ControllerServiceCapability_RPC_Type) *csi.ControllerServiceCapability {
7575
return &csi.ControllerServiceCapability{
7676
Type: &csi.ControllerServiceCapability_Rpc{
7777
Rpc: &csi.ControllerServiceCapability_RPC{
78-
Type: cap,
78+
Type: c,
7979
},
8080
},
8181
}
8282
}
8383

84-
func NewNodeServiceCapability(cap csi.NodeServiceCapability_RPC_Type) *csi.NodeServiceCapability {
84+
func NewNodeServiceCapability(c csi.NodeServiceCapability_RPC_Type) *csi.NodeServiceCapability {
8585
return &csi.NodeServiceCapability{
8686
Type: &csi.NodeServiceCapability_Rpc{
8787
Rpc: &csi.NodeServiceCapability_RPC{
88-
Type: cap,
88+
Type: c,
8989
},
9090
},
9191
}

pkg/csi-common/utils_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -220,52 +220,52 @@ func TestNewVolumeCapabilityAccessMode(t *testing.T) {
220220

221221
func TestNewControllerServiceCapability(t *testing.T) {
222222
tests := []struct {
223-
cap csi.ControllerServiceCapability_RPC_Type
223+
c csi.ControllerServiceCapability_RPC_Type
224224
}{
225225
{
226-
cap: csi.ControllerServiceCapability_RPC_UNKNOWN,
226+
c: csi.ControllerServiceCapability_RPC_UNKNOWN,
227227
},
228228
{
229-
cap: csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME,
229+
c: csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME,
230230
},
231231
{
232-
cap: csi.ControllerServiceCapability_RPC_PUBLISH_UNPUBLISH_VOLUME,
232+
c: csi.ControllerServiceCapability_RPC_PUBLISH_UNPUBLISH_VOLUME,
233233
},
234234
{
235-
cap: csi.ControllerServiceCapability_RPC_LIST_VOLUMES,
235+
c: csi.ControllerServiceCapability_RPC_LIST_VOLUMES,
236236
},
237237
{
238-
cap: csi.ControllerServiceCapability_RPC_GET_CAPACITY,
238+
c: csi.ControllerServiceCapability_RPC_GET_CAPACITY,
239239
},
240240
{
241-
cap: csi.ControllerServiceCapability_RPC_CLONE_VOLUME,
241+
c: csi.ControllerServiceCapability_RPC_CLONE_VOLUME,
242242
},
243243
}
244244
for _, test := range tests {
245-
resp := NewControllerServiceCapability(test.cap)
245+
resp := NewControllerServiceCapability(test.c)
246246
assert.NotNil(t, resp)
247247
}
248248
}
249249

250250
func TestNewNodeServiceCapability(t *testing.T) {
251251
tests := []struct {
252-
cap csi.NodeServiceCapability_RPC_Type
252+
c csi.NodeServiceCapability_RPC_Type
253253
}{
254254
{
255-
cap: csi.NodeServiceCapability_RPC_UNKNOWN,
255+
c: csi.NodeServiceCapability_RPC_UNKNOWN,
256256
},
257257
{
258-
cap: csi.NodeServiceCapability_RPC_STAGE_UNSTAGE_VOLUME,
258+
c: csi.NodeServiceCapability_RPC_STAGE_UNSTAGE_VOLUME,
259259
},
260260
{
261-
cap: csi.NodeServiceCapability_RPC_GET_VOLUME_STATS,
261+
c: csi.NodeServiceCapability_RPC_GET_VOLUME_STATS,
262262
},
263263
{
264-
cap: csi.NodeServiceCapability_RPC_EXPAND_VOLUME,
264+
c: csi.NodeServiceCapability_RPC_EXPAND_VOLUME,
265265
},
266266
}
267267
for _, test := range tests {
268-
resp := NewNodeServiceCapability(test.cap)
268+
resp := NewNodeServiceCapability(test.c)
269269
assert.NotNil(t, resp)
270270
}
271271
}

0 commit comments

Comments
 (0)