Skip to content

Commit

Permalink
Fix format calls as suggested by vet
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Morozov <[email protected]>
  • Loading branch information
LK4D4 committed Jan 14, 2015
1 parent bb96e53 commit a75b02f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion integration-cli/docker_cli_rm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
12 changes: 6 additions & 6 deletions integration-cli/docker_cli_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion integration-cli/docker_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion nat/nat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
2 changes: 1 addition & 1 deletion registry/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a75b02f

Please sign in to comment.