Skip to content

Commit 7be433e

Browse files
authored
Merge pull request #139 from Madhu-1/fix_lint
Fix small lint issues
2 parents 393375a + 8f81366 commit 7be433e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

pkg/controller/controller.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,9 @@ func makeVolumeName(prefix, pvcUID string, volumeNameUUIDLength int) (string, er
326326
if volumeNameUUIDLength == -1 {
327327
// Default behavior is to not truncate or remove dashes
328328
return fmt.Sprintf("%s-%s", prefix, pvcUID), nil
329-
} else {
330-
// Else we remove all dashes from UUID and truncate to volumeNameUUIDLength
331-
return fmt.Sprintf("%s-%s", prefix, strings.Replace(string(pvcUID), "-", "", -1)[0:volumeNameUUIDLength]), nil
332329
}
330+
// Else we remove all dashes from UUID and truncate to volumeNameUUIDLength
331+
return fmt.Sprintf("%s-%s", prefix, strings.Replace(string(pvcUID), "-", "", -1)[0:volumeNameUUIDLength]), nil
333332

334333
}
335334

@@ -338,7 +337,7 @@ func (p *csiProvisioner) Provision(options controller.VolumeOptions) (*v1.Persis
338337
return nil, fmt.Errorf("claim Selector is not supported")
339338
}
340339

341-
var needSnapshotSupport bool = false
340+
var needSnapshotSupport bool
342341
if options.PVC.Spec.DataSource != nil {
343342
// PVC.Spec.DataSource.Name is the name of the VolumeSnapshot API object
344343
if options.PVC.Spec.DataSource.Name == "" {

pkg/controller/controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ func TestGetDriverName(t *testing.T) {
352352
in := &csi.GetPluginInfoRequest{}
353353

354354
out := test.output
355-
var injectedErr error = nil
355+
var injectedErr error
356356
if test.injectError {
357357
injectedErr = fmt.Errorf("mock error")
358358
}

0 commit comments

Comments
 (0)