Browse Source

Add minor vet fixes

Signed-off-by: Antonio Murdaca <runcom@linux.com>
Antonio Murdaca 10 years ago
parent
commit
26ce3f4c90
3 changed files with 10 additions and 10 deletions
  1. 1 1
      integration-cli/docker_cli_exec_test.go
  2. 6 6
      runconfig/exec_test.go
  3. 3 3
      runconfig/hostconfig_test.go

+ 1 - 1
integration-cli/docker_cli_exec_test.go

@@ -479,7 +479,7 @@ func (s *DockerSuite) TestInspectExecID(c *check.C) {
 	// But we should still be able to query the execID
 	sc, body, err := sockRequest("GET", "/exec/"+execID+"/json", nil)
 	if sc != http.StatusOK {
-		c.Fatalf("received status != 200 OK: %s\n%s", sc, body)
+		c.Fatalf("received status != 200 OK: %d\n%s", sc, body)
 	}
 }
 

+ 6 - 6
runconfig/exec_test.go

@@ -2,9 +2,10 @@ package runconfig
 
 import (
 	"fmt"
-	flag "github.com/docker/docker/pkg/mflag"
 	"io/ioutil"
 	"testing"
+
+	flag "github.com/docker/docker/pkg/mflag"
 )
 
 type arguments struct {
@@ -118,11 +119,10 @@ func compareExecConfig(config1 *ExecConfig, config2 *ExecConfig) bool {
 	}
 	if len(config1.Cmd) != len(config2.Cmd) {
 		return false
-	} else {
-		for index, value := range config1.Cmd {
-			if value != config2.Cmd[index] {
-				return false
-			}
+	}
+	for index, value := range config1.Cmd {
+		if value != config2.Cmd[index] {
+			return false
 		}
 	}
 	return true

+ 3 - 3
runconfig/hostconfig_test.go

@@ -248,11 +248,11 @@ func TestDecodeHostConfig(t *testing.T) {
 		}
 
 		if c.Privileged != false {
-			t.Fatalf("Expected privileged false, found %s\n", c.Privileged)
+			t.Fatalf("Expected privileged false, found %v\n", c.Privileged)
 		}
 
-		if len(c.Binds) != 1 {
-			t.Fatalf("Expected 1 bind, found %v\n", c.Binds)
+		if l := len(c.Binds); l != 1 {
+			t.Fatalf("Expected 1 bind, found %d\n", l)
 		}
 
 		if c.CapAdd.Len() != 1 && c.CapAdd.Slice()[0] != "NET_ADMIN" {