From 32d5efcf7e3a37743350b12eb893c8a55641e3c7 Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Wed, 2 Apr 2025 09:23:29 +0000 Subject: [PATCH] chore: fix golint errors --- pkg/nfs/controllerserver.go | 2 +- pkg/nfs/utils.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/nfs/controllerserver.go b/pkg/nfs/controllerserver.go index ff1a9167..db34c340 100644 --- a/pkg/nfs/controllerserver.go +++ b/pkg/nfs/controllerserver.go @@ -800,7 +800,7 @@ func getNfsVolFromID(id string) (*nfsVolume, error) { // try with separator "/" volRegex := regexp.MustCompile("^([^/]+)/(.*)/([^/]+)$") tokens := volRegex.FindStringSubmatch(id) - if tokens == nil || len(tokens) < 4 { + if len(tokens) < 4 { return nil, fmt.Errorf("could not split %s into server, baseDir and subDir with separator(%s)", id, "/") } server = tokens[1] diff --git a/pkg/nfs/utils.go b/pkg/nfs/utils.go index 53737cb2..6b59a234 100644 --- a/pkg/nfs/utils.go +++ b/pkg/nfs/utils.go @@ -67,21 +67,21 @@ func NewControllerServer(d *Driver) *ControllerServer { } } -func NewControllerServiceCapability(cap csi.ControllerServiceCapability_RPC_Type) *csi.ControllerServiceCapability { +func NewControllerServiceCapability(c csi.ControllerServiceCapability_RPC_Type) *csi.ControllerServiceCapability { return &csi.ControllerServiceCapability{ Type: &csi.ControllerServiceCapability_Rpc{ Rpc: &csi.ControllerServiceCapability_RPC{ - Type: cap, + Type: c, }, }, } } -func NewNodeServiceCapability(cap csi.NodeServiceCapability_RPC_Type) *csi.NodeServiceCapability { +func NewNodeServiceCapability(c csi.NodeServiceCapability_RPC_Type) *csi.NodeServiceCapability { return &csi.NodeServiceCapability{ Type: &csi.NodeServiceCapability_Rpc{ Rpc: &csi.NodeServiceCapability_RPC{ - Type: cap, + Type: c, }, }, }