Browse code

Fix vet errors

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>

Alexandr Morozov authored on 2014/11/06 01:26:22
Showing 9 changed files
... ...
@@ -109,7 +109,7 @@ func main() {
109 109
 	if err := cli.Cmd(flag.Args()...); err != nil {
110 110
 		if sterr, ok := err.(*utils.StatusError); ok {
111 111
 			if sterr.Status != "" {
112
-				log.Println("%s", sterr.Status)
112
+				log.Println(sterr.Status)
113 113
 			}
114 114
 			os.Exit(sterr.StatusCode)
115 115
 		}
... ...
@@ -218,7 +218,7 @@ func TestBuildEnvironmentReplacementEnv(t *testing.T) {
218 218
 		if parts[0] == "bar" {
219 219
 			found = true
220 220
 			if parts[1] != "foo" {
221
-				t.Fatal("Could not find replaced var for env `bar`: got %q instead of `foo`", parts[1])
221
+				t.Fatalf("Could not find replaced var for env `bar`: got %q instead of `foo`", parts[1])
222 222
 			}
223 223
 		}
224 224
 	}
... ...
@@ -1224,7 +1224,7 @@ func TestBuildCopyDisallowRemote(t *testing.T) {
1224 1224
 COPY https://index.docker.io/robots.txt /`,
1225 1225
 		true)
1226 1226
 	if err == nil || !strings.Contains(out, "Source can't be a URL for COPY") {
1227
-		t.Fatal("Error should be about disallowed remote source, got err: %s, out: %q", err, out)
1227
+		t.Fatalf("Error should be about disallowed remote source, got err: %s, out: %q", err, out)
1228 1228
 	}
1229 1229
 	logDone("build - copy - disallow copy from remote")
1230 1230
 }
... ...
@@ -1374,7 +1374,7 @@ func TestBuildForceRm(t *testing.T) {
1374 1374
 	buildCmd := exec.Command(dockerBinary, "build", "-t", name, "--force-rm", ".")
1375 1375
 	buildCmd.Dir = ctx.Dir
1376 1376
 	if out, _, err := runCommandWithOutput(buildCmd); err == nil {
1377
-		t.Fatal("failed to build the image: %s, %v", out, err)
1377
+		t.Fatalf("failed to build the image: %s, %v", out, err)
1378 1378
 	}
1379 1379
 
1380 1380
 	containerCountAfter, err := getContainerCount()
... ...
@@ -3181,7 +3181,7 @@ func TestBuildEntrypointInheritance(t *testing.T) {
3181 3181
 	status, _ = runCommand(exec.Command(dockerBinary, "run", "child"))
3182 3182
 
3183 3183
 	if status != 5 {
3184
-		t.Fatal("expected exit code 5 but received %d", status)
3184
+		t.Fatalf("expected exit code 5 but received %d", status)
3185 3185
 	}
3186 3186
 
3187 3187
 	logDone("build - clear entrypoint")
... ...
@@ -47,7 +47,7 @@ RUN echo "Z"`,
47 47
 
48 48
 	out, exitCode, err := runCommandWithOutput(exec.Command(dockerBinary, "history", "testbuildhistory"))
49 49
 	if err != nil || exitCode != 0 {
50
-		t.Fatal("failed to get image history: %s, %v", out, err)
50
+		t.Fatalf("failed to get image history: %s, %v", out, err)
51 51
 	}
52 52
 
53 53
 	actualValues := strings.Split(out, "\n")[1:27]
... ...
@@ -11,7 +11,7 @@ func TestInfoEnsureSucceeds(t *testing.T) {
11 11
 	versionCmd := exec.Command(dockerBinary, "info")
12 12
 	out, exitCode, err := runCommandWithOutput(versionCmd)
13 13
 	if err != nil || exitCode != 0 {
14
-		t.Fatal("failed to execute docker info: %s, %v", out, err)
14
+		t.Fatalf("failed to execute docker info: %s, %v", out, err)
15 15
 	}
16 16
 
17 17
 	stringsToCheck := []string{"Containers:", "Execution Driver:", "Kernel Version:"}
... ...
@@ -11,7 +11,7 @@ import (
11 11
 func TestPullImageFromCentralRegistry(t *testing.T) {
12 12
 	pullCmd := exec.Command(dockerBinary, "pull", "scratch")
13 13
 	if out, _, err := runCommandWithOutput(pullCmd); err != nil {
14
-		t.Fatal("pulling the scratch image from the registry has failed: %s, %v", out, err)
14
+		t.Fatalf("pulling the scratch image from the registry has failed: %s, %v", out, err)
15 15
 	}
16 16
 	logDone("pull - pull scratch")
17 17
 }
... ...
@@ -20,7 +20,7 @@ func TestPullImageFromCentralRegistry(t *testing.T) {
20 20
 func TestPullNonExistingImage(t *testing.T) {
21 21
 	pullCmd := exec.Command(dockerBinary, "pull", "fooblahblah1234")
22 22
 	if out, _, err := runCommandWithOutput(pullCmd); err == nil {
23
-		t.Fatal("expected non-zero exit status when pulling non-existing image: %s", out)
23
+		t.Fatalf("expected non-zero exit status when pulling non-existing image: %s", out)
24 24
 	}
25 25
 	logDone("pull - pull fooblahblah1234 (non-existing image)")
26 26
 }
... ...
@@ -16,12 +16,12 @@ func TestPushBusyboxImage(t *testing.T) {
16 16
 	repoName := fmt.Sprintf("%v/busybox", privateRegistryURL)
17 17
 	tagCmd := exec.Command(dockerBinary, "tag", "busybox", repoName)
18 18
 	if out, _, err := runCommandWithOutput(tagCmd); err != nil {
19
-		t.Fatal("image tagging failed: %s, %v", out, err)
19
+		t.Fatalf("image tagging failed: %s, %v", out, err)
20 20
 	}
21 21
 
22 22
 	pushCmd := exec.Command(dockerBinary, "push", repoName)
23 23
 	if out, _, err := runCommandWithOutput(pushCmd); err != nil {
24
-		t.Fatal("pushing the image to the private registry has failed: %s, %v", out, err)
24
+		t.Fatalf("pushing the image to the private registry has failed: %s, %v", out, err)
25 25
 	}
26 26
 
27 27
 	deleteImages(repoName)
... ...
@@ -35,7 +35,7 @@ func TestPushUnprefixedRepo(t *testing.T) {
35 35
 	t.Skip()
36 36
 	pushCmd := exec.Command(dockerBinary, "push", "busybox")
37 37
 	if out, _, err := runCommandWithOutput(pushCmd); err == nil {
38
-		t.Fatal("pushing an unprefixed repo didn't result in a non-zero exit status: %s", out)
38
+		t.Fatalf("pushing an unprefixed repo didn't result in a non-zero exit status: %s", out)
39 39
 	}
40 40
 	logDone("push - push unprefixed busybox repo --> must fail")
41 41
 }
... ...
@@ -114,7 +114,7 @@ func TestRmInvalidContainer(t *testing.T) {
114 114
 	if out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "rm", "unknown")); err == nil {
115 115
 		t.Fatal("Expected error on rm unknown container, got none")
116 116
 	} else if !strings.Contains(out, "failed to remove one or more containers") {
117
-		t.Fatal("Expected output to contain 'failed to remove one or more containers', got %q", out)
117
+		t.Fatalf("Expected output to contain 'failed to remove one or more containers', got %q", out)
118 118
 	}
119 119
 
120 120
 	logDone("rm - delete unknown container")
... ...
@@ -11,7 +11,7 @@ func TestSearchOnCentralRegistry(t *testing.T) {
11 11
 	searchCmd := exec.Command(dockerBinary, "search", "busybox")
12 12
 	out, exitCode, err := runCommandWithOutput(searchCmd)
13 13
 	if err != nil || exitCode != 0 {
14
-		t.Fatal("failed to search on the central registry: %s, %v", out, err)
14
+		t.Fatalf("failed to search on the central registry: %s, %v", out, err)
15 15
 	}
16 16
 
17 17
 	if !strings.Contains(out, "Busybox base image.") {
... ...
@@ -11,7 +11,7 @@ func TestVersionEnsureSucceeds(t *testing.T) {
11 11
 	versionCmd := exec.Command(dockerBinary, "version")
12 12
 	out, _, err := runCommandWithOutput(versionCmd)
13 13
 	if err != nil {
14
-		t.Fatal("failed to execute docker version: %s, %v", out, err)
14
+		t.Fatalf("failed to execute docker version: %s, %v", out, err)
15 15
 	}
16 16
 
17 17
 	stringsToCheck := []string{