cleanup: address gocritic warnings

Add explanation to nolint directives.

Issue reported:
whyNoLint: include an explanation for nolint directive (gocritic)

Signed-off-by: Yug <yuggupta27@gmail.com>
This commit is contained in:
Yug 2020-07-13 10:52:16 +05:30 committed by mergify[bot]
parent 628ae9e982
commit 48fa43270f
4 changed files with 6 additions and 4 deletions

View File

@ -62,7 +62,6 @@ func execCommandErr(ctx context.Context, program string, args ...string) error {
return err return err
} }
//nolint: unparam
func execCommandJSON(ctx context.Context, v interface{}, program string, args ...string) error { func execCommandJSON(ctx context.Context, v interface{}, program string, args ...string) error {
stdout, _, err := execCommand(ctx, program, args...) stdout, _, err := execCommand(ctx, program, args...)
if err != nil { if err != nil {

View File

@ -682,7 +682,8 @@ func (cs *ControllerServer) ValidateVolumeCapabilities(ctx context.Context, req
// CreateSnapshot creates the snapshot in backend and stores metadata // CreateSnapshot creates the snapshot in backend and stores metadata
// in store // in store
// nolint: gocyclo // TODO: make this function less complex
// nolint:gocyclo // complexity needs to be reduced.
func (cs *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error) { func (cs *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error) {
if err := cs.validateSnapshotReq(ctx, req); err != nil { if err := cs.validateSnapshotReq(ctx, req); err != nil {
return nil, err return nil, err

View File

@ -98,7 +98,8 @@ var (
// - Map the image (creates a device) // - Map the image (creates a device)
// - Create the staging file/directory under staging path // - Create the staging file/directory under staging path
// - Stage the device (mount the device mapped for image) // - Stage the device (mount the device mapped for image)
// nolint: gocyclo // TODO: make this function less complex
// nolint:gocyclo // complexity needs to be reduced.
func (ns *NodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error) { func (ns *NodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error) {
if err := util.ValidateNodeStageVolumeRequest(req); err != nil { if err := util.ValidateNodeStageVolumeRequest(req); err != nil {
return nil, err return nil, err

View File

@ -32,7 +32,8 @@ func cleanupTestData() {
os.RemoveAll(basePath) os.RemoveAll(basePath)
} }
// nolint: gocyclo // TODO: make this function less complex
// nolint:gocyclo // complexity needs to be reduced.
func TestCSIConfig(t *testing.T) { func TestCSIConfig(t *testing.T) {
var err error var err error
var data string var data string