From 6d9bb99c97438edc996e51e13a0aca0feabc5d26 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Tue, 27 Oct 2015 09:05:25 -0700 Subject: [PATCH] Return pointer from newBaseContainer It makes code more consistent. Signed-off-by: Alexander Morozov --- daemon/daemon.go | 6 +++--- daemon/daemon_unix.go | 4 ++-- daemon/daemon_windows.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/daemon/daemon.go b/daemon/daemon.go index 5159d4f7da..3321fea773 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -177,10 +177,10 @@ func (daemon *Daemon) load(id string) (*Container, error) { } if container.ID != id { - return &container, fmt.Errorf("Container %s is stored at %s", container.ID, id) + return container, fmt.Errorf("Container %s is stored at %s", container.ID, id) } - return &container, nil + return container, nil } // Register makes a container object usable by the daemon as @@ -492,7 +492,7 @@ func (daemon *Daemon) newContainer(name string, config *runconfig.Config, imgID base.Driver = daemon.driver.String() base.ExecDriver = daemon.execDriver.Name() - return &base, err + return base, err } // GetFullContainerName returns a constructed container name. I think diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index 7431580cbb..c94ea49b52 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -599,8 +599,8 @@ func (daemon *Daemon) registerLinks(container *Container, hostConfig *runconfig. return nil } -func (daemon *Daemon) newBaseContainer(id string) Container { - return Container{ +func (daemon *Daemon) newBaseContainer(id string) *Container { + return &Container{ CommonContainer: CommonContainer{ ID: id, State: NewState(), diff --git a/daemon/daemon_windows.go b/daemon/daemon_windows.go index b829a8fd19..258891a51f 100644 --- a/daemon/daemon_windows.go +++ b/daemon/daemon_windows.go @@ -140,8 +140,8 @@ func (daemon *Daemon) registerLinks(container *Container, hostConfig *runconfig. return nil } -func (daemon *Daemon) newBaseContainer(id string) Container { - return Container{ +func (daemon *Daemon) newBaseContainer(id string) *Container { + return &Container{ CommonContainer: CommonContainer{ ID: id, State: NewState(),