Fix gofmt & golint

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #412
Approved by: baude
This commit is contained in:
Matthew Heon
2018-02-27 15:36:36 -05:00
committed by Atomic Bot
parent 780baec1d9
commit 83d7ae6506
5 changed files with 13 additions and 14 deletions

View File

@ -252,7 +252,7 @@ func (c *Container) Exec(tty, privileged bool, env, cmd []string, user string) e
// This really ought to be a do-while, but Go doesn't have those... // This really ought to be a do-while, but Go doesn't have those...
for found { for found {
found = false found = false
for id, _ := range c.state.ExecSessions { for id := range c.state.ExecSessions {
if id == sessionID { if id == sessionID {
found = true found = true
break break
@ -277,7 +277,7 @@ func (c *Container) Exec(tty, privileged bool, env, cmd []string, user string) e
// Wait until runc makes the pidfile // Wait until runc makes the pidfile
// TODO: If runc errors before the PID file is created, we have to wait for timeout here // TODO: If runc errors before the PID file is created, we have to wait for timeout here
if err := WaitForFile(pidFile, pidWaitTimeout * time.Millisecond); err != nil { if err := WaitForFile(pidFile, pidWaitTimeout*time.Millisecond); err != nil {
logrus.Debugf("Timed out waiting for pidfile from runc for container %s exec", c.ID()) logrus.Debugf("Timed out waiting for pidfile from runc for container %s exec", c.ID())
// Check if an error occurred in the process before we made a pidfile // Check if an error occurred in the process before we made a pidfile
@ -600,9 +600,8 @@ func (c *Container) Wait() (int32, error) {
} }
if !stopped { if !stopped {
return false, nil return false, nil
} else { // nolint }
return true, nil // nolint return true, nil
} // nolint
}, },
) )
if err != nil { if err != nil {

View File

@ -21,7 +21,7 @@ func (c *Container) getContainerInspectData(size bool, driverData *inspect.Data)
} }
execIDs := []string{} execIDs := []string{}
for id, _ := range c.state.ExecSessions { for id := range c.state.ExecSessions {
execIDs = append(execIDs, id) execIDs = append(execIDs, id)
} }

View File

@ -102,7 +102,7 @@ func (c *Container) attachSocketPath() string {
// Get PID file path for a container's exec session // Get PID file path for a container's exec session
func (c *Container) execPidPath(sessionID string) string { func (c *Container) execPidPath(sessionID string) string {
return filepath.Join(c.state.RunDir, "exec_pid_" + sessionID) return filepath.Join(c.state.RunDir, "exec_pid_"+sessionID)
} }
// Sync this container with on-disk state and runc status // Sync this container with on-disk state and runc status