chore: fix golint errors

This commit is contained in:
andyzhangx 2025-04-02 09:23:29 +00:00
parent bb35d633db
commit 32d5efcf7e
2 changed files with 5 additions and 5 deletions

View File

@ -800,7 +800,7 @@ func getNfsVolFromID(id string) (*nfsVolume, error) {
// try with separator "/" // try with separator "/"
volRegex := regexp.MustCompile("^([^/]+)/(.*)/([^/]+)$") volRegex := regexp.MustCompile("^([^/]+)/(.*)/([^/]+)$")
tokens := volRegex.FindStringSubmatch(id) 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, "/") return nil, fmt.Errorf("could not split %s into server, baseDir and subDir with separator(%s)", id, "/")
} }
server = tokens[1] server = tokens[1]

View File

@ -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{ return &csi.ControllerServiceCapability{
Type: &csi.ControllerServiceCapability_Rpc{ Type: &csi.ControllerServiceCapability_Rpc{
Rpc: &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{ return &csi.NodeServiceCapability{
Type: &csi.NodeServiceCapability_Rpc{ Type: &csi.NodeServiceCapability_Rpc{
Rpc: &csi.NodeServiceCapability_RPC{ Rpc: &csi.NodeServiceCapability_RPC{
Type: cap, Type: c,
}, },
}, },
} }