summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-02-27 15:36:36 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-01 21:17:51 +0000
commit83d7ae6506f7aaf1f7d543412a148b4bf4cd6657 (patch)
tree229b1f3b746541ce6c269e6fe73661795b6d675e /libpod
parent780baec1d9fc6f733d06fafddb53655784e2f6f1 (diff)
downloadpodman-83d7ae6506f7aaf1f7d543412a148b4bf4cd6657.tar.gz
podman-83d7ae6506f7aaf1f7d543412a148b4bf4cd6657.tar.bz2
podman-83d7ae6506f7aaf1f7d543412a148b4bf4cd6657.zip
Fix gofmt & golint
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #412 Approved by: baude
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_api.go9
-rw-r--r--libpod/container_inspect.go2
-rw-r--r--libpod/container_internal.go2
-rw-r--r--libpod/sql_state.go2
-rw-r--r--libpod/test_common.go12
5 files changed, 13 insertions, 14 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index 17cd68972..e8185ae19 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -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...
for found {
found = false
- for id, _ := range c.state.ExecSessions {
+ for id := range c.state.ExecSessions {
if id == sessionID {
found = true
break
@@ -277,7 +277,7 @@ func (c *Container) Exec(tty, privileged bool, env, cmd []string, user string) e
// Wait until runc makes the pidfile
// 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())
// 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 {
return false, nil
- } else { // nolint
- return true, nil // nolint
- } // nolint
+ }
+ return true, nil
},
)
if err != nil {
diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go
index de5770f8f..3a1728826 100644
--- a/libpod/container_inspect.go
+++ b/libpod/container_inspect.go
@@ -21,7 +21,7 @@ func (c *Container) getContainerInspectData(size bool, driverData *inspect.Data)
}
execIDs := []string{}
- for id, _ := range c.state.ExecSessions {
+ for id := range c.state.ExecSessions {
execIDs = append(execIDs, id)
}
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 61f3410c9..3223961fa 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -102,7 +102,7 @@ func (c *Container) attachSocketPath() string {
// Get PID file path for a container's exec session
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
diff --git a/libpod/sql_state.go b/libpod/sql_state.go
index abf48543f..b3e531ba1 100644
--- a/libpod/sql_state.go
+++ b/libpod/sql_state.go
@@ -313,7 +313,7 @@ func (s *SQLState) UpdateContainer(ctr *Container) error {
&netNSPath,
&ipAddress,
&subnetMask,
- &execSessions)
+ &execSessions)
if err != nil {
// The container may not exist in the database
if err == sql.ErrNoRows {
diff --git a/libpod/test_common.go b/libpod/test_common.go
index b03212a5a..8b8248188 100644
--- a/libpod/test_common.go
+++ b/libpod/test_common.go
@@ -49,12 +49,12 @@ func getTestContainer(id, name, locksDir string) (*Container, error) {
},
},
state: &containerState{
- State: ContainerStateRunning,
- ConfigPath: "/does/not/exist/specs/" + id,
- RunDir: "/does/not/exist/tmp/",
- Mounted: true,
- Mountpoint: "/does/not/exist/tmp/" + id,
- PID: 1234,
+ State: ContainerStateRunning,
+ ConfigPath: "/does/not/exist/specs/" + id,
+ RunDir: "/does/not/exist/tmp/",
+ Mounted: true,
+ Mountpoint: "/does/not/exist/tmp/" + id,
+ PID: 1234,
ExecSessions: map[string]int{"abcd": 101, "ef01": 202},
},
valid: true,