Browse code

Add minor vet fixes

Signed-off-by: Antonio Murdaca <runcom@linux.com>

Antonio Murdaca authored on 2015/07/13 02:12:48
Showing 3 changed files
... ...
@@ -479,7 +479,7 @@ func (s *DockerSuite) TestInspectExecID(c *check.C) {
479 479
 	// But we should still be able to query the execID
480 480
 	sc, body, err := sockRequest("GET", "/exec/"+execID+"/json", nil)
481 481
 	if sc != http.StatusOK {
482
-		c.Fatalf("received status != 200 OK: %s\n%s", sc, body)
482
+		c.Fatalf("received status != 200 OK: %d\n%s", sc, body)
483 483
 	}
484 484
 }
485 485
 
... ...
@@ -2,9 +2,10 @@ package runconfig
2 2
 
3 3
 import (
4 4
 	"fmt"
5
-	flag "github.com/docker/docker/pkg/mflag"
6 5
 	"io/ioutil"
7 6
 	"testing"
7
+
8
+	flag "github.com/docker/docker/pkg/mflag"
8 9
 )
9 10
 
10 11
 type arguments struct {
... ...
@@ -118,11 +119,10 @@ func compareExecConfig(config1 *ExecConfig, config2 *ExecConfig) bool {
118 118
 	}
119 119
 	if len(config1.Cmd) != len(config2.Cmd) {
120 120
 		return false
121
-	} else {
122
-		for index, value := range config1.Cmd {
123
-			if value != config2.Cmd[index] {
124
-				return false
125
-			}
121
+	}
122
+	for index, value := range config1.Cmd {
123
+		if value != config2.Cmd[index] {
124
+			return false
126 125
 		}
127 126
 	}
128 127
 	return true
... ...
@@ -248,11 +248,11 @@ func TestDecodeHostConfig(t *testing.T) {
248 248
 		}
249 249
 
250 250
 		if c.Privileged != false {
251
-			t.Fatalf("Expected privileged false, found %s\n", c.Privileged)
251
+			t.Fatalf("Expected privileged false, found %v\n", c.Privileged)
252 252
 		}
253 253
 
254
-		if len(c.Binds) != 1 {
255
-			t.Fatalf("Expected 1 bind, found %v\n", c.Binds)
254
+		if l := len(c.Binds); l != 1 {
255
+			t.Fatalf("Expected 1 bind, found %d\n", l)
256 256
 		}
257 257
 
258 258
 		if c.CapAdd.Len() != 1 && c.CapAdd.Slice()[0] != "NET_ADMIN" {