From aad639c1fa859d29bf1e10b1d60d949dd6c12792 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 23 Sep 2022 22:28:03 +0200 Subject: [PATCH] volume: fix empty-lines (revive) volume/mounts/parser_test.go:42:39: empty-lines: extra empty line at the end of a block (revive) volume/mounts/windows_parser.go:129:24: empty-lines: extra empty line at the end of a block (revive) volume/local/local_test.go:16:35: empty-lines: extra empty line at the end of a block (revive) volume/local/local_unix.go:145:3: early-return: if c {...} else {... return } can be simplified to if !c { ... return } ... (revive) volume/service/service_test.go:18:38: empty-lines: extra empty line at the end of a block (revive) Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 188724a59773822e4a37794d5ccde6e113d9fac0) Signed-off-by: Sebastiaan van Stijn --- volume/local/local_test.go | 1 - volume/local/local_unix.go | 5 +---- volume/mounts/parser_test.go | 1 - volume/mounts/windows_parser.go | 1 - volume/service/service_test.go | 1 - 5 files changed, 1 insertion(+), 8 deletions(-) diff --git a/volume/local/local_test.go b/volume/local/local_test.go index 5e95c74bfe..5f8ccf7541 100644 --- a/volume/local/local_test.go +++ b/volume/local/local_test.go @@ -26,7 +26,6 @@ func TestGetAddress(t *testing.T) { t.Errorf("Test case failed for %s actual: %s expected : %s", name, v, success) } } - } func TestGetPassword(t *testing.T) { diff --git a/volume/local/local_unix.go b/volume/local/local_unix.go index 94dcc27f92..051aef7a1e 100644 --- a/volume/local/local_unix.go +++ b/volume/local/local_unix.go @@ -143,10 +143,7 @@ func (v *localVolume) postMount() error { } if v.opts.Quota.Size > 0 { if v.quotaCtl != nil { - err := v.quotaCtl.SetQuota(v.path, v.opts.Quota) - if err != nil { - return err - } + return v.quotaCtl.SetQuota(v.path, v.opts.Quota) } else { return errors.New("size quota requested for volume but no quota support") } diff --git a/volume/mounts/parser_test.go b/volume/mounts/parser_test.go index 201dd629de..67c8d4c065 100644 --- a/volume/mounts/parser_test.go +++ b/volume/mounts/parser_test.go @@ -87,5 +87,4 @@ func TestParseMountSpec(t *testing.T) { t.Errorf("Expected mount copy data to match. Expected: '%v', Actual: '%v'", c.expected.CopyData, mp.CopyData) } } - } diff --git a/volume/mounts/windows_parser.go b/volume/mounts/windows_parser.go index 2e587bcc83..94f24cfc54 100644 --- a/volume/mounts/windows_parser.go +++ b/volume/mounts/windows_parser.go @@ -128,7 +128,6 @@ func (p *windowsParser) splitRawSpec(raw string, splitRegexp *regexp.Regexp) ([] exists, isDir, _ := p.fi.fileInfo(matchgroups["destination"]) if exists && !isDir { return nil, fmt.Errorf("file '%s' cannot be mapped. Only directories can be mapped on this platform", matchgroups["destination"]) - } } } diff --git a/volume/service/service_test.go b/volume/service/service_test.go index 289315d090..431c3526e5 100644 --- a/volume/service/service_test.go +++ b/volume/service/service_test.go @@ -45,7 +45,6 @@ func TestServiceCreate(t *testing.T) { assert.NilError(t, err) _, err = service.Create(ctx, "v1", "d2") assert.NilError(t, err) - } func TestServiceList(t *testing.T) {