aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-02-07 15:31:09 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-02-09 15:01:34 +0000
commit86d549f2cdaf22e07017d04c9eb0afbbf4475934 (patch)
tree228167ac26e3ac88cfb82ef3c00b1e971bec8968
parent19840e0b3d3f3e4389152c8e96cfe92f68d024eb (diff)
downloadpodman-86d549f2cdaf22e07017d04c9eb0afbbf4475934.tar.gz
podman-86d549f2cdaf22e07017d04c9eb0afbbf4475934.tar.bz2
podman-86d549f2cdaf22e07017d04c9eb0afbbf4475934.zip
Fix gofmt and lint
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #268 Approved by: rhatdan
-rw-r--r--libpod/container_internal.go8
-rw-r--r--libpod/sql_state_internal.go1
-rw-r--r--libpod/state_test.go6
3 files changed, 6 insertions, 9 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index d434630a3..858cf3cbe 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -424,7 +424,7 @@ func (c *Container) WriteStringToRundir(destFile, output string) (string, error)
return destFileName, nil
}
-type resolv struct {
+type resolvConf struct {
nameServers []string
searchDomains []string
options []string
@@ -477,8 +477,8 @@ func (c *Container) generateResolvConf() (string, error) {
}
// createResolv creates a resolv struct from an input string
-func createResolv(input string) resolv {
- var resolv resolv
+func createResolv(input string) resolvConf {
+ var resolv resolvConf
for _, line := range strings.Split(input, "\n") {
if strings.HasPrefix(line, "search") {
fields := strings.Fields(line)
@@ -507,7 +507,7 @@ func createResolv(input string) resolv {
}
//ToString returns a resolv struct in the form of a resolv.conf
-func (r resolv) ToString() string {
+func (r resolvConf) ToString() string {
var result string
// Populate the output string with search domains
result += fmt.Sprintf("search %s\n", strings.Join(r.searchDomains, " "))
diff --git a/libpod/sql_state_internal.go b/libpod/sql_state_internal.go
index 5a1b68615..5bc2d84f5 100644
--- a/libpod/sql_state_internal.go
+++ b/libpod/sql_state_internal.go
@@ -37,6 +37,7 @@ const (
FROM containers
INNER JOIN
containerState ON containers.Id = containerState.Id `
+ // ExistsQuery is a query to check if a pod exists
ExistsQuery = "SELECT 1 FROM pods WHERE Id=?;"
)
diff --git a/libpod/state_test.go b/libpod/state_test.go
index f18393e23..b98674134 100644
--- a/libpod/state_test.go
+++ b/libpod/state_test.go
@@ -1119,7 +1119,6 @@ func TestAddPodDuplicateNameFails(t *testing.T) {
err = state.AddPod(testPod2)
assert.Error(t, err)
-
allPods, err := state.AllPods()
assert.NoError(t, err)
assert.Equal(t, 1, len(allPods))
@@ -1160,7 +1159,6 @@ func TestAddPodCtrIDConflictFails(t *testing.T) {
err = state.AddPod(testPod)
assert.Error(t, err)
-
allPods, err := state.AllPods()
assert.NoError(t, err)
assert.Equal(t, 0, len(allPods))
@@ -1181,7 +1179,6 @@ func TestAddPodCtrNameConflictFails(t *testing.T) {
err = state.AddPod(testPod)
assert.Error(t, err)
-
allPods, err := state.AllPods()
assert.NoError(t, err)
assert.Equal(t, 0, len(allPods))
@@ -1270,7 +1267,6 @@ func TestRemovePodNotEmptyFails(t *testing.T) {
err = state.RemovePod(testPod)
assert.Error(t, err)
-
allPods, err := state.AllPods()
assert.NoError(t, err)
assert.Equal(t, 1, len(allPods))
@@ -1305,7 +1301,7 @@ func TestRemovePodAfterEmptySucceeds(t *testing.T) {
}
func TestAllPodsEmptyOnEmptyState(t *testing.T) {
- runForAllStates(t , func(t *testing.T, state State, lockPath string) {
+ runForAllStates(t, func(t *testing.T, state State, lockPath string) {
allPods, err := state.AllPods()
assert.NoError(t, err)
assert.Equal(t, 0, len(allPods))