From f4f56b1197934858b15d7b0548b2821a8e1322e2 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 27 Nov 2019 15:43:53 +0100 Subject: [PATCH] daemon: normalize comment formatting Signed-off-by: Sebastiaan van Stijn --- daemon/container.go | 2 +- daemon/container_linux.go | 2 +- daemon/events/events_test.go | 6 +++--- daemon/images/images.go | 2 +- daemon/links/links.go | 2 +- daemon/list.go | 2 +- daemon/network/settings.go | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/daemon/container.go b/daemon/container.go index a82d60c268..a06d503015 100644 --- a/daemon/container.go +++ b/daemon/container.go @@ -154,7 +154,7 @@ func (daemon *Daemon) newContainer(name string, operatingSystem string, config * base.Created = time.Now().UTC() base.Managed = managed base.Path = entrypoint - base.Args = args //FIXME: de-duplicate from config + base.Args = args // FIXME: de-duplicate from config base.Config = config base.HostConfig = &containertypes.HostConfig{} base.ImageID = imgID diff --git a/daemon/container_linux.go b/daemon/container_linux.go index 0818f62a89..f81aa82931 100644 --- a/daemon/container_linux.go +++ b/daemon/container_linux.go @@ -8,7 +8,7 @@ import ( ) func (daemon *Daemon) saveApparmorConfig(container *container.Container) error { - container.AppArmorProfile = "" //we don't care about the previous value. + container.AppArmorProfile = "" // we don't care about the previous value. if !daemon.apparmorEnabled { return nil // if apparmor is disabled there is nothing to do here. diff --git a/daemon/events/events_test.go b/daemon/events/events_test.go index d11521567f..6a193fc084 100644 --- a/daemon/events/events_test.go +++ b/daemon/events/events_test.go @@ -163,9 +163,9 @@ func TestLogEvents(t *testing.T) { // https://github.com/docker/docker/issues/20999 // Fixtures: // -//2016-03-07T17:28:03.022433271+02:00 container die 0b863f2a26c18557fc6cdadda007c459f9ec81b874780808138aea78a3595079 (image=ubuntu, name=small_hoover) -//2016-03-07T17:28:03.091719377+02:00 network disconnect 19c5ed41acb798f26b751e0035cd7821741ab79e2bbd59a66b5fd8abf954eaa0 (type=bridge, container=0b863f2a26c18557fc6cdadda007c459f9ec81b874780808138aea78a3595079, name=bridge) -//2016-03-07T17:28:03.129014751+02:00 container destroy 0b863f2a26c18557fc6cdadda007c459f9ec81b874780808138aea78a3595079 (image=ubuntu, name=small_hoover) +// 2016-03-07T17:28:03.022433271+02:00 container die 0b863f2a26c18557fc6cdadda007c459f9ec81b874780808138aea78a3595079 (image=ubuntu, name=small_hoover) +// 2016-03-07T17:28:03.091719377+02:00 network disconnect 19c5ed41acb798f26b751e0035cd7821741ab79e2bbd59a66b5fd8abf954eaa0 (type=bridge, container=0b863f2a26c18557fc6cdadda007c459f9ec81b874780808138aea78a3595079, name=bridge) +// 2016-03-07T17:28:03.129014751+02:00 container destroy 0b863f2a26c18557fc6cdadda007c459f9ec81b874780808138aea78a3595079 (image=ubuntu, name=small_hoover) func TestLoadBufferedEvents(t *testing.T) { now := time.Now() f, err := timetypes.GetTimestamp("2016-03-07T17:28:03.100000000+02:00", now) diff --git a/daemon/images/images.go b/daemon/images/images.go index d17a2e2455..0288556e68 100644 --- a/daemon/images/images.go +++ b/daemon/images/images.go @@ -171,7 +171,7 @@ func (i *ImageService) Images(imageFilters filters.Args, all bool, withExtraAttr if all || len(i.imageStore.Children(id)) == 0 { if imageFilters.Contains("dangling") && !danglingOnly { - //dangling=false case, so dangling image is not needed + // dangling=false case, so dangling image is not needed continue } if imageFilters.Contains("reference") { // skip images with no references if filtering by reference diff --git a/daemon/links/links.go b/daemon/links/links.go index be153f6bb0..911a5aca12 100644 --- a/daemon/links/links.go +++ b/daemon/links/links.go @@ -56,7 +56,7 @@ func (l *Link) ToEnv() []string { env = append(env, fmt.Sprintf("%s_PORT=%s://%s:%s", alias, p.Proto(), l.ChildIP, p.Port())) } - //sort the ports so that we can bulk the continuous ports together + // sort the ports so that we can bulk the continuous ports together nat.Sort(l.Ports, func(ip, jp nat.Port) bool { // If the two ports have the same number, tcp takes priority // Sort in desc order diff --git a/daemon/list.go b/daemon/list.go index 69fb69a90c..19f806ce43 100644 --- a/daemon/list.go +++ b/daemon/list.go @@ -388,7 +388,7 @@ func portOp(key string, filter map[nat.Port]bool) func(value string) error { if strings.Contains(value, ":") { return fmt.Errorf("filter for '%s' should not contain ':': %s", key, value) } - //support two formats, original format /[] or /[] + // support two formats, original format /[] or /[] proto, port := nat.SplitProtoPort(value) start, end, err := nat.ParsePortRange(port) if err != nil { diff --git a/daemon/network/settings.go b/daemon/network/settings.go index 7696d40201..39646c45ee 100644 --- a/daemon/network/settings.go +++ b/daemon/network/settings.go @@ -39,8 +39,8 @@ type EndpointSettings struct { // AttachmentStore stores the load balancer IP address for a network id. type AttachmentStore struct { sync.Mutex - //key: networkd id - //value: load balancer ip address + // key: networkd id + // value: load balancer ip address networkToNodeLBIP map[string]net.IP }