From f8e5145e9650b8727ff38fcaf4c31e81bdd14ecc Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 23 Sep 2022 22:37:50 +0200 Subject: [PATCH] runconfig, oci, image, layer, distribution: fix empty-lines (revive) runconfig/config_test.go:23:46: empty-lines: extra empty line at the start of a block (revive) runconfig/config_test.go:75:55: empty-lines: extra empty line at the start of a block (revive) oci/devices_linux.go:57:34: empty-lines: extra empty line at the start of a block (revive) oci/devices_linux.go:60:69: empty-lines: extra empty line at the start of a block (revive) image/fs_test.go:53:38: empty-lines: extra empty line at the end of a block (revive) image/tarexport/save.go:88:29: empty-lines: extra empty line at the end of a block (revive) layer/layer_unix_test.go:21:34: empty-lines: extra empty line at the end of a block (revive) distribution/xfer/download.go:302:9: empty-lines: extra empty line at the end of a block (revive) distribution/manifest_test.go:154:99: empty-lines: extra empty line at the end of a block (revive) distribution/manifest_test.go:329:52: empty-lines: extra empty line at the end of a block (revive) distribution/manifest_test.go:354:59: empty-lines: extra empty line at the end of a block (revive) registry/config_test.go:323:42: empty-lines: extra empty line at the end of a block (revive) registry/config_test.go:350:33: empty-lines: extra empty line at the end of a block (revive) Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 8a2e1245d42d3fb1d27e61b83774354129eb123a) Signed-off-by: Sebastiaan van Stijn --- distribution/manifest_test.go | 3 --- distribution/xfer/download.go | 1 - image/fs_test.go | 1 - image/tarexport/save.go | 1 - layer/layer_unix_test.go | 1 - oci/devices_linux.go | 2 -- registry/config_test.go | 2 -- runconfig/config_test.go | 2 -- 8 files changed, 13 deletions(-) diff --git a/distribution/manifest_test.go b/distribution/manifest_test.go index 52b7c3e676..072e686a50 100644 --- a/distribution/manifest_test.go +++ b/distribution/manifest_test.go @@ -171,7 +171,6 @@ func TestManifestStore(t *testing.T) { err = w.Commit(ctx, desc.Size, desc.Digest, opts...) assert.NilError(t, err) - } // All tests should end up with no active ingest @@ -348,7 +347,6 @@ func TestDetectManifestBlobMediaType(t *testing.T) { assert.Equal(t, mt, tc.expected) }) } - } func TestDetectManifestBlobMediaTypeInvalid(t *testing.T) { @@ -418,5 +416,4 @@ func TestDetectManifestBlobMediaTypeInvalid(t *testing.T) { assert.Equal(t, mt, "") }) } - } diff --git a/distribution/xfer/download.go b/distribution/xfer/download.go index af1a3995d2..32f2338e96 100644 --- a/distribution/xfer/download.go +++ b/distribution/xfer/download.go @@ -313,7 +313,6 @@ func (ldm *LayerDownloadManager) makeDownloadFunc(descriptor DownloadDescriptor, d.err = errors.New("download cancelled during retry delay") return } - } } diff --git a/image/fs_test.go b/image/fs_test.go index 7cc4a2b7fe..5db5c060d4 100644 --- a/image/fs_test.go +++ b/image/fs_test.go @@ -78,7 +78,6 @@ func TestFSInvalidRoot(t *testing.T) { os.RemoveAll(root) } - } func TestFSMetadataGetSet(t *testing.T) { diff --git a/image/tarexport/save.go b/image/tarexport/save.go index 504dbce585..c07d7c983c 100644 --- a/image/tarexport/save.go +++ b/image/tarexport/save.go @@ -138,7 +138,6 @@ func (l *tarexporter) parseNames(names []string) (desc map[image.ID]*imageDescri if err := addAssoc(image.IDFromDigest(id), namedRef); err != nil { return nil, err } - } return imgDescr, nil } diff --git a/layer/layer_unix_test.go b/layer/layer_unix_test.go index a497413b16..64cda566b1 100644 --- a/layer/layer_unix_test.go +++ b/layer/layer_unix_test.go @@ -63,5 +63,4 @@ func TestLayerSize(t *testing.T) { if expected := len(content1) + len(content2); int(layer2Size) != expected { t.Fatalf("Unexpected size %d, expected %d", layer2Size, expected) } - } diff --git a/oci/devices_linux.go b/oci/devices_linux.go index ca1c4886b9..44414c6112 100644 --- a/oci/devices_linux.go +++ b/oci/devices_linux.go @@ -55,10 +55,8 @@ func DevicesFromPath(pathOnHost, pathInContainer, cgroupPermissions string) (dev // if the device is not a device node // try to see if it's a directory holding many devices if err == devices.ErrNotADevice { - // check if it is a directory if src, e := os.Stat(resolvedPathOnHost); e == nil && src.IsDir() { - // mount the internal devices recursively // TODO check if additional errors should be handled or logged _ = filepath.Walk(resolvedPathOnHost, func(dpath string, f os.FileInfo, _ error) error { diff --git a/registry/config_test.go b/registry/config_test.go index 123cedee0f..77f799df96 100644 --- a/registry/config_test.go +++ b/registry/config_test.go @@ -352,9 +352,7 @@ func TestValidateIndexName(t *testing.T) { if assert.Check(t, err) { assert.Check(t, is.Equal(testCase.expect, result)) } - } - } func TestValidateIndexNameWithError(t *testing.T) { diff --git a/runconfig/config_test.go b/runconfig/config_test.go index bbadcce297..7aad4d470e 100644 --- a/runconfig/config_test.go +++ b/runconfig/config_test.go @@ -21,7 +21,6 @@ type f struct { } func TestDecodeContainerConfig(t *testing.T) { - var ( fixtures []f image string @@ -73,7 +72,6 @@ func TestDecodeContainerConfig(t *testing.T) { // to the daemon in the hostConfig structure. Note this is platform specific // as to what level of container isolation is supported. func TestDecodeContainerConfigIsolation(t *testing.T) { - // An Invalid isolation level if _, _, _, err := callDecodeContainerConfigIsolation("invalid"); err != nil { if !strings.Contains(err.Error(), `Invalid isolation: "invalid"`) {