Browse code

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 <github@gone.nl>

Sebastiaan van Stijn authored on 2022/09/24 05:33:15
Showing 9 changed files
... ...
@@ -562,7 +562,6 @@ func (daemon *Daemon) allocateNetwork(container *container.Container) (retErr er
562 562
 		if err := daemon.connectToNetwork(container, defaultNetName, nConf.EndpointSettings, updateSettings); err != nil {
563 563
 			return err
564 564
 		}
565
-
566 565
 	}
567 566
 
568 567
 	// the intermediate map is necessary because "connectToNetwork" modifies "container.NetworkSettings.Networks"
... ...
@@ -601,7 +600,6 @@ func (daemon *Daemon) allocateNetwork(container *container.Container) (retErr er
601 601
 				}
602 602
 			}()
603 603
 		}
604
-
605 604
 	}
606 605
 
607 606
 	if _, err := container.WriteHostConfig(); err != nil {
... ...
@@ -342,5 +342,4 @@ func TestRootMountCleanup(t *testing.T) {
342 342
 		checkMounted(t, cfg.Root, false)
343 343
 		assert.Assert(t, d.cleanupMounts())
344 344
 	})
345
-
346 345
 }
... ...
@@ -557,7 +557,6 @@ func verifyPlatformContainerResources(resources *containertypes.Resources, sysIn
557 557
 	if len(resources.BlkioDeviceWriteBps) > 0 && !sysInfo.BlkioWriteBpsDevice {
558 558
 		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.")
559 559
 		resources.BlkioDeviceWriteBps = []*pblkiodev.ThrottleDevice{}
560
-
561 560
 	}
562 561
 	if len(resources.BlkioDeviceReadIOps) > 0 && !sysInfo.BlkioReadIOpsDevice {
563 562
 		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 {
1089 1089
 //
1090 1090
 // If names are used, they are verified to exist in passwd/group
1091 1091
 func parseRemappedRoot(usergrp string) (string, string, error) {
1092
-
1093 1092
 	var (
1094 1093
 		userID, groupID     int
1095 1094
 		username, groupname string
... ...
@@ -815,7 +815,6 @@ func buildCreateEndpointOptions(c *container.Container, n libnetwork.Network, ep
815 815
 					return nil, errors.Errorf("Invalid link-local IP address: %s", ipam.LinkLocalIPs)
816 816
 				}
817 817
 				ipList = append(ipList, linkip)
818
-
819 818
 			}
820 819
 
821 820
 			if ip = net.ParseIP(ipam.IPv4Address); ip == nil && ipam.IPv4Address != "" {
... ...
@@ -828,7 +827,6 @@ func buildCreateEndpointOptions(c *container.Container, n libnetwork.Network, ep
828 828
 
829 829
 			createOptions = append(createOptions,
830 830
 				libnetwork.CreateOptionIpam(ip, ip6, ipList, nil))
831
-
832 831
 		}
833 832
 
834 833
 		for _, alias := range epConfig.Aliases {
... ...
@@ -882,7 +880,6 @@ func buildCreateEndpointOptions(c *container.Container, n libnetwork.Network, ep
882 882
 
883 883
 			createOptions = append(createOptions, libnetwork.EndpointOptionGeneric(genericOption))
884 884
 		}
885
-
886 885
 	}
887 886
 
888 887
 	// Port-mapping rules belong to the container & applicable only to non-internal networks
... ...
@@ -173,7 +173,6 @@ func TestFilterNetworks(t *testing.T) {
173 173
 			if testCase.err != "" {
174 174
 				if err == nil {
175 175
 					t.Fatalf("expect error '%s', got no error", testCase.err)
176
-
177 176
 				} else if !strings.Contains(err.Error(), testCase.err) {
178 177
 					t.Fatalf("expect error '%s', got '%s'", testCase.err, err)
179 178
 				}
... ...
@@ -706,7 +706,6 @@ func WithMounts(daemon *Daemon, c *container.Container) coci.SpecOpts {
706 706
 		}
707 707
 
708 708
 		return nil
709
-
710 709
 	}
711 710
 }
712 711
 
... ...
@@ -404,5 +404,4 @@ func TestDaemonReloadNetworkDiagnosticPort(t *testing.T) {
404 404
 	if !daemon.netController.IsDiagnosticEnabled() {
405 405
 		t.Fatalf("diagnostic should be enable")
406 406
 	}
407
-
408 407
 }
... ...
@@ -24,7 +24,6 @@ func (daemon *Daemon) ContainerRestart(ctx context.Context, name string, options
24 24
 		return fmt.Errorf("Cannot restart container %s: %v", name, err)
25 25
 	}
26 26
 	return nil
27
-
28 27
 }
29 28
 
30 29
 // containerRestart attempts to gracefully stop and then start the
... ...
@@ -15,7 +15,6 @@ import (
15 15
 )
16 16
 
17 17
 func TestWithSeccomp(t *testing.T) {
18
-
19 18
 	type expected struct {
20 19
 		daemon  *Daemon
21 20
 		c       *container.Container