golint fixes for daemon/ package

- some method names were changed to have a 'Locking' suffix, as the
 downcased versions already existed, and the existing functions simply
 had locks around the already downcased version.
 - deleting unused functions
 - package comment
 - magic numbers replaced by golang constants
 - comments all over

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
This commit is contained in:
Morgan Bauer
2015-08-27 22:07:42 -07:00
parent 04b0fb6314
commit abd72d4008
49 changed files with 637 additions and 468 deletions
+8 -6
View File
@@ -5,6 +5,8 @@ import (
"github.com/docker/docker/runconfig"
)
// ContainerCommitConfig contains build configs for commit operation,
// and is used when making a commit with the current state of the container.
type ContainerCommitConfig struct {
Pause bool
Repo string
@@ -15,14 +17,14 @@ type ContainerCommitConfig struct {
}
// Commit creates a new filesystem image from the current state of a container.
// The image can optionally be tagged into a repository
// The image can optionally be tagged into a repository.
func (daemon *Daemon) Commit(container *Container, c *ContainerCommitConfig) (*image.Image, error) {
if c.Pause && !container.IsPaused() {
container.Pause()
defer container.Unpause()
if c.Pause && !container.isPaused() {
container.pause()
defer container.unpause()
}
rwTar, err := container.ExportRw()
rwTar, err := container.exportRw()
if err != nil {
return nil, err
}
@@ -55,6 +57,6 @@ func (daemon *Daemon) Commit(container *Container, c *ContainerCommitConfig) (*i
return img, err
}
}
container.LogEvent("commit")
container.logEvent("commit")
return img, nil
}