From ddb42f3ad204f6ea4312c4db71bc01105e87d3c1 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 23 Sep 2022 22:33:15 +0200 Subject: [PATCH] daemon: fix empty-lines (revive) daemon/network/filter_test.go:174:19: empty-lines: extra empty line at the end of a block (revive) daemon/restart.go:17:116: empty-lines: extra empty line at the end of a block (revive) daemon/daemon_linux_test.go:255:41: empty-lines: extra empty line at the end of a block (revive) daemon/reload_test.go:340:58: empty-lines: extra empty line at the end of a block (revive) daemon/oci_linux.go:495:101: empty-lines: extra empty line at the end of a block (revive) daemon/seccomp_linux_test.go:17:36: empty-lines: extra empty line at the start of a block (revive) daemon/container_operations.go:560:73: empty-lines: extra empty line at the end of a block (revive) daemon/daemon_unix.go:558:76: empty-lines: extra empty line at the end of a block (revive) daemon/daemon_unix.go:1092:64: empty-lines: extra empty line at the start of a block (revive) daemon/container_operations.go:587:24: empty-lines: extra empty line at the end of a block (revive) daemon/network.go:807:18: empty-lines: extra empty line at the end of a block (revive) daemon/network.go:813:42: empty-lines: extra empty line at the end of a block (revive) daemon/network.go:872:72: empty-lines: extra empty line at the end of a block (revive) Signed-off-by: Sebastiaan van Stijn --- daemon/container_operations.go | 2 -- daemon/daemon_linux_test.go | 1 - daemon/daemon_unix.go | 2 -- daemon/network.go | 3 --- daemon/network/filter_test.go | 1 - daemon/oci_linux.go | 1 - daemon/reload_test.go | 1 - daemon/restart.go | 1 - daemon/seccomp_linux_test.go | 1 - 9 files changed, 13 deletions(-) diff --git a/daemon/container_operations.go b/daemon/container_operations.go index d8f7411a37..907944ebfe 100644 --- a/daemon/container_operations.go +++ b/daemon/container_operations.go @@ -562,7 +562,6 @@ func (daemon *Daemon) allocateNetwork(container *container.Container) (retErr er if err := daemon.connectToNetwork(container, defaultNetName, nConf.EndpointSettings, updateSettings); err != nil { return err } - } // the intermediate map is necessary because "connectToNetwork" modifies "container.NetworkSettings.Networks" @@ -601,7 +600,6 @@ func (daemon *Daemon) allocateNetwork(container *container.Container) (retErr er } }() } - } if _, err := container.WriteHostConfig(); err != nil { diff --git a/daemon/daemon_linux_test.go b/daemon/daemon_linux_test.go index aab0c8af72..b8c89b9e82 100644 --- a/daemon/daemon_linux_test.go +++ b/daemon/daemon_linux_test.go @@ -342,5 +342,4 @@ func TestRootMountCleanup(t *testing.T) { checkMounted(t, cfg.Root, false) assert.Assert(t, d.cleanupMounts()) }) - } diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index 3becb30199..20b08e75e2 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -557,7 +557,6 @@ func verifyPlatformContainerResources(resources *containertypes.Resources, sysIn if len(resources.BlkioDeviceWriteBps) > 0 && !sysInfo.BlkioWriteBpsDevice { warnings = append(warnings, "Your kernel does not support BPS Block I/O write limit or the cgroup is not mounted. Block I/O BPS write limit discarded.") resources.BlkioDeviceWriteBps = []*pblkiodev.ThrottleDevice{} - } if len(resources.BlkioDeviceReadIOps) > 0 && !sysInfo.BlkioReadIOpsDevice { warnings = append(warnings, "Your kernel does not support IOPS Block read limit or the cgroup is not mounted. Block I/O IOPS read limit discarded.") @@ -1089,7 +1088,6 @@ func setupInitLayer(idMapping idtools.IdentityMapping) func(string) error { // // If names are used, they are verified to exist in passwd/group func parseRemappedRoot(usergrp string) (string, string, error) { - var ( userID, groupID int username, groupname string diff --git a/daemon/network.go b/daemon/network.go index c468d7f6e7..08bcc47ad2 100644 --- a/daemon/network.go +++ b/daemon/network.go @@ -815,7 +815,6 @@ func buildCreateEndpointOptions(c *container.Container, n libnetwork.Network, ep return nil, errors.Errorf("Invalid link-local IP address: %s", ipam.LinkLocalIPs) } ipList = append(ipList, linkip) - } if ip = net.ParseIP(ipam.IPv4Address); ip == nil && ipam.IPv4Address != "" { @@ -828,7 +827,6 @@ func buildCreateEndpointOptions(c *container.Container, n libnetwork.Network, ep createOptions = append(createOptions, libnetwork.CreateOptionIpam(ip, ip6, ipList, nil)) - } for _, alias := range epConfig.Aliases { @@ -882,7 +880,6 @@ func buildCreateEndpointOptions(c *container.Container, n libnetwork.Network, ep createOptions = append(createOptions, libnetwork.EndpointOptionGeneric(genericOption)) } - } // Port-mapping rules belong to the container & applicable only to non-internal networks diff --git a/daemon/network/filter_test.go b/daemon/network/filter_test.go index 40634f80e1..e2ce013c5f 100644 --- a/daemon/network/filter_test.go +++ b/daemon/network/filter_test.go @@ -173,7 +173,6 @@ func TestFilterNetworks(t *testing.T) { if testCase.err != "" { if err == nil { t.Fatalf("expect error '%s', got no error", testCase.err) - } else if !strings.Contains(err.Error(), testCase.err) { t.Fatalf("expect error '%s', got '%s'", testCase.err, err) } diff --git a/daemon/oci_linux.go b/daemon/oci_linux.go index b0ca314fd8..3330930fe8 100644 --- a/daemon/oci_linux.go +++ b/daemon/oci_linux.go @@ -706,7 +706,6 @@ func WithMounts(daemon *Daemon, c *container.Container) coci.SpecOpts { } return nil - } } diff --git a/daemon/reload_test.go b/daemon/reload_test.go index a5a79259eb..0d72f1dd4c 100644 --- a/daemon/reload_test.go +++ b/daemon/reload_test.go @@ -404,5 +404,4 @@ func TestDaemonReloadNetworkDiagnosticPort(t *testing.T) { if !daemon.netController.IsDiagnosticEnabled() { t.Fatalf("diagnostic should be enable") } - } diff --git a/daemon/restart.go b/daemon/restart.go index a6c8ddbb24..2f69f0cc24 100644 --- a/daemon/restart.go +++ b/daemon/restart.go @@ -24,7 +24,6 @@ func (daemon *Daemon) ContainerRestart(ctx context.Context, name string, options return fmt.Errorf("Cannot restart container %s: %v", name, err) } return nil - } // containerRestart attempts to gracefully stop and then start the diff --git a/daemon/seccomp_linux_test.go b/daemon/seccomp_linux_test.go index c44af03446..6b5d517b99 100644 --- a/daemon/seccomp_linux_test.go +++ b/daemon/seccomp_linux_test.go @@ -15,7 +15,6 @@ import ( ) func TestWithSeccomp(t *testing.T) { - type expected struct { daemon *Daemon c *container.Container