From a75b02fe72f3da73f9788919ff2c22f183978db7 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Wed, 14 Jan 2015 14:12:03 -0800 Subject: [PATCH] Fix format calls as suggested by vet Signed-off-by: Alexander Morozov --- integration-cli/docker_cli_rm_test.go | 2 +- integration-cli/docker_cli_run_test.go | 12 ++++++------ integration-cli/docker_utils.go | 2 +- nat/nat_test.go | 2 +- registry/auth_test.go | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/integration-cli/docker_cli_rm_test.go b/integration-cli/docker_cli_rm_test.go index c3069a3eed..89ede7abc6 100644 --- a/integration-cli/docker_cli_rm_test.go +++ b/integration-cli/docker_cli_rm_test.go @@ -67,7 +67,7 @@ func TestRmRunningContainerCheckError409(t *testing.T) { t.Fatalf("Expected error, can't rm a running container") } if !strings.Contains(err.Error(), "409 Conflict") { - t.Fatalf("Expected error to contain '409 Conflict' but found", err) + t.Fatalf("Expected error to contain '409 Conflict' but found %s", err) } deleteAllContainers() diff --git a/integration-cli/docker_cli_run_test.go b/integration-cli/docker_cli_run_test.go index 5108d197dc..8fc97b684c 100644 --- a/integration-cli/docker_cli_run_test.go +++ b/integration-cli/docker_cli_run_test.go @@ -319,18 +319,18 @@ func TestRunLinksContainerWithContainerName(t *testing.T) { cmd := exec.Command(dockerBinary, "run", "-t", "-d", "--name", "parent", "busybox") out, _, _, err := runCommandWithStdoutStderr(cmd) if err != nil { - t.Fatal("failed to run container: %v, output: %q", err, out) + t.Fatalf("failed to run container: %v, output: %q", err, out) } cmd = exec.Command(dockerBinary, "inspect", "-f", "{{.NetworkSettings.IPAddress}}", "parent") ip, _, _, err := runCommandWithStdoutStderr(cmd) if err != nil { - t.Fatal("failed to inspect container: %v, output: %q", err, ip) + t.Fatalf("failed to inspect container: %v, output: %q", err, ip) } ip = strings.TrimSpace(ip) cmd = exec.Command(dockerBinary, "run", "--link", "parent:test", "busybox", "/bin/cat", "/etc/hosts") out, _, err = runCommandWithOutput(cmd) if err != nil { - t.Fatal("failed to run container: %v, output: %q", err, out) + t.Fatalf("failed to run container: %v, output: %q", err, out) } if !strings.Contains(out, ip+" test") { t.Fatalf("use a container name to link target failed") @@ -345,19 +345,19 @@ func TestRunLinksContainerWithContainerId(t *testing.T) { cmd := exec.Command(dockerBinary, "run", "-t", "-d", "busybox") cID, _, _, err := runCommandWithStdoutStderr(cmd) if err != nil { - t.Fatal("failed to run container: %v, output: %q", err, cID) + t.Fatalf("failed to run container: %v, output: %q", err, cID) } cID = strings.TrimSpace(cID) cmd = exec.Command(dockerBinary, "inspect", "-f", "{{.NetworkSettings.IPAddress}}", cID) ip, _, _, err := runCommandWithStdoutStderr(cmd) if err != nil { - t.Fatal("faild to inspect container: %v, output: %q", err, ip) + t.Fatalf("faild to inspect container: %v, output: %q", err, ip) } ip = strings.TrimSpace(ip) cmd = exec.Command(dockerBinary, "run", "--link", cID+":test", "busybox", "/bin/cat", "/etc/hosts") out, _, err := runCommandWithOutput(cmd) if err != nil { - t.Fatal("failed to run container: %v, output: %q", err, out) + t.Fatalf("failed to run container: %v, output: %q", err, out) } if !strings.Contains(out, ip+" test") { t.Fatalf("use a container id to link target failed") diff --git a/integration-cli/docker_utils.go b/integration-cli/docker_utils.go index 03d34b6d70..219e87a5dd 100644 --- a/integration-cli/docker_utils.go +++ b/integration-cli/docker_utils.go @@ -226,7 +226,7 @@ out2: case <-tick: i++ if i > 4 { - d.t.Log("tried to interrupt daemon for %d times, now try to kill it", i) + d.t.Logf("tried to interrupt daemon for %d times, now try to kill it", i) break out2 } d.t.Logf("Attempt #%d: daemon is still running with pid %d", i, d.cmd.Process.Pid) diff --git a/nat/nat_test.go b/nat/nat_test.go index 34c210e6e2..376857fd72 100644 --- a/nat/nat_test.go +++ b/nat/nat_test.go @@ -281,7 +281,7 @@ func TestParsePortSpecsWithRange(t *testing.T) { for portspec, bindings := range bindingMap { _, port := SplitProtoPort(string(portspec)) if len(bindings) != 1 || bindings[0].HostIp != "0.0.0.0" || bindings[0].HostPort != port { - t.Fatalf("Expect single binding to port %d but found %s", port, bindings) + t.Fatalf("Expect single binding to port %s but found %s", port, bindings) } } diff --git a/registry/auth_test.go b/registry/auth_test.go index 22f879946a..9cc299aabe 100644 --- a/registry/auth_test.go +++ b/registry/auth_test.go @@ -151,7 +151,7 @@ func TestResolveAuthConfigFullURL(t *testing.T) { for configKey, registries := range validRegistries { configured, ok := expectedAuths[configKey] if !ok || configured.Email == "" { - t.Fatal() + t.Fail() } index := &IndexInfo{ Name: configKey,