Enable all static-checks in golangci-lint

* Enable all static-checks in golangci-lint
* Update golangci-lint version
* Fix issue found in golangci-lint

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2019-06-10 12:18:41 +05:30
parent 47d4e44af0
commit a38986fce0
21 changed files with 85 additions and 87 deletions

View File

@ -39,7 +39,7 @@ func (cs *DefaultControllerServer) ControllerUnpublishVolume(ctx context.Context
return nil, status.Error(codes.Unimplemented, "")
}
//ControllerExpandVolume expand volume
// ControllerExpandVolume expand volume
func (cs *DefaultControllerServer) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error) {
return nil, status.Error(codes.Unimplemented, "")
}

View File

@ -37,7 +37,7 @@ type CSIDriver struct {
// NewCSIDriver Creates a NewCSIDriver object. Assumes vendor
// version is equal to driver version & does not support optional
// driver plugin info manifest field. Refer to CSI spec for more details.
func NewCSIDriver(name string, v string, nodeID string) *CSIDriver {
func NewCSIDriver(name, v, nodeID string) *CSIDriver {
if name == "" {
klog.Errorf("Driver name missing")
return nil
@ -48,7 +48,7 @@ func NewCSIDriver(name string, v string, nodeID string) *CSIDriver {
return nil
}
// TODO version format and validation
if len(v) == 0 {
if v == "" {
klog.Errorf("Version argument missing")
return nil
}

View File

@ -64,11 +64,11 @@ func NewDefaultControllerServer(d *CSIDriver) *DefaultControllerServer {
}
// NewControllerServiceCapability returns controller capabilities
func NewControllerServiceCapability(cap csi.ControllerServiceCapability_RPC_Type) *csi.ControllerServiceCapability {
func NewControllerServiceCapability(ctrlCap csi.ControllerServiceCapability_RPC_Type) *csi.ControllerServiceCapability {
return &csi.ControllerServiceCapability{
Type: &csi.ControllerServiceCapability_Rpc{
Rpc: &csi.ControllerServiceCapability_RPC{
Type: cap,
Type: ctrlCap,
},
},
}