diff --git a/api_test.go b/api_test.go index c2e7db4bd0..4306f74100 100644 --- a/api_test.go +++ b/api_test.go @@ -19,25 +19,25 @@ import ( func TestGetBoolParam(t *testing.T) { if ret, err := getBoolParam("true"); err != nil || !ret { - t.Fatalf("true -> true, nil | got %b %s", ret, err) + t.Fatalf("true -> true, nil | got %t %s", ret, err) } if ret, err := getBoolParam("True"); err != nil || !ret { - t.Fatalf("True -> true, nil | got %b %s", ret, err) + t.Fatalf("True -> true, nil | got %t %s", ret, err) } if ret, err := getBoolParam("1"); err != nil || !ret { - t.Fatalf("1 -> true, nil | got %b %s", ret, err) + t.Fatalf("1 -> true, nil | got %t %s", ret, err) } if ret, err := getBoolParam(""); err != nil || ret { - t.Fatalf("\"\" -> false, nil | got %b %s", ret, err) + t.Fatalf("\"\" -> false, nil | got %t %s", ret, err) } if ret, err := getBoolParam("false"); err != nil || ret { - t.Fatalf("false -> false, nil | got %b %s", ret, err) + t.Fatalf("false -> false, nil | got %t %s", ret, err) } if ret, err := getBoolParam("0"); err != nil || ret { - t.Fatalf("0 -> false, nil | got %b %s", ret, err) + t.Fatalf("0 -> false, nil | got %t %s", ret, err) } if ret, err := getBoolParam("faux"); err == nil || ret { - t.Fatalf("faux -> false, err | got %b %s", ret, err) + t.Fatalf("faux -> false, err | got %t %s", ret, err) } } diff --git a/commands.go b/commands.go index 3ce8c8eb98..6ada02d552 100644 --- a/commands.go +++ b/commands.go @@ -345,7 +345,7 @@ func (cli *DockerCli) CmdLogin(args ...string) error { } auth.SaveConfig(cli.authConfig) if out2.Status != "" { - fmt.Fprintln(cli.out, "%s\n", out2.Status) + fmt.Fprintf(cli.out, "%s\n", out2.Status) } return nil } @@ -370,7 +370,7 @@ func (cli *DockerCli) CmdWait(args ...string) error { if err != nil { return err } - fmt.Fprintf(cli.out, "%s\n", out.StatusCode) + fmt.Fprintf(cli.out, "%d\n", out.StatusCode) } } return nil @@ -405,7 +405,7 @@ func (cli *DockerCli) CmdVersion(args ...string) error { fmt.Fprintf(cli.out, "Git commit: %s\n", out.GitCommit) } if out.GoVersion != "" { - fmt.Fprintln(cli.out, "Go version: %s\n", out.GoVersion) + fmt.Fprintf(cli.out, "Go version: %s\n", out.GoVersion) } return nil } @@ -513,7 +513,7 @@ func (cli *DockerCli) CmdStart(args ...string) error { if err != nil { fmt.Fprintf(cli.err, "%s\n", err) } else { - fmt.Fprintln(cli.out, "%s\n", name) + fmt.Fprintf(cli.out, "%s\n", name) } } return nil diff --git a/graph.go b/graph.go index f2b2ccec8e..0bf7eccdbe 100644 --- a/graph.go +++ b/graph.go @@ -189,7 +189,7 @@ func (graph *Graph) Mktemp(id string) (string, error) { return "", fmt.Errorf("Couldn't create temp: %s", err) } if tmp.Exists(id) { - return "", fmt.Errorf("Image %d already exists", id) + return "", fmt.Errorf("Image %s already exists", id) } return tmp.imageRoot(id), nil } diff --git a/utils/utils.go b/utils/utils.go index 6e12f1f1bb..e5b2a0f4fd 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -87,7 +87,7 @@ func (r *progressReader) Read(p []byte) (n int, err error) { } if r.readProgress-r.lastUpdate > updateEvery || err != nil { if r.readTotal > 0 { - fmt.Fprintf(r.output, r.template, HumanSize(int64(r.readProgress)), HumanSize(int64(r.readTotal)), fmt.Sprintf("%2.0f%%",float64(r.readProgress)/float64(r.readTotal)*100)) + fmt.Fprintf(r.output, r.template, HumanSize(int64(r.readProgress)), HumanSize(int64(r.readTotal)), fmt.Sprintf("%2.0f%%", float64(r.readProgress)/float64(r.readTotal)*100)) } else { fmt.Fprintf(r.output, r.template, r.readProgress, "?", "n/a") } @@ -133,7 +133,7 @@ func HumanDuration(d time.Duration) string { } else if hours < 24*365*2 { return fmt.Sprintf("%d months", hours/24/30) } - return fmt.Sprintf("%d years", d.Hours()/24/365) + return fmt.Sprintf("%f years", d.Hours()/24/365) } // HumanSize returns a human-readable approximation of a size