From 15b30881570369564bde3f7d8faf4491b2ebfaab Mon Sep 17 00:00:00 2001 From: Caleb Spare Date: Sat, 30 Mar 2013 00:22:56 -0700 Subject: [PATCH] Don't convert []byte to string unnecessarily. --- auth/auth.go | 4 ++-- container_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/auth/auth.go b/auth/auth.go index e6aa048136..886d210f61 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -152,11 +152,11 @@ func Login(authConfig *AuthConfig) (string, error) { return "", errors.New(status) } } else { - status = fmt.Sprintf("Registration: %s", string(reqBody)) + status = fmt.Sprintf("Registration: %s", reqBody) return "", errors.New(status) } } else { - status = fmt.Sprintf("[%s] : %s", reqStatusCode, string(reqBody)) + status = fmt.Sprintf("[%s] : %s", reqStatusCode, reqBody) return "", errors.New(status) } if storeConfig { diff --git a/container_test.go b/container_test.go index fdc7f5703a..45d334ca22 100644 --- a/container_test.go +++ b/container_test.go @@ -227,7 +227,7 @@ func TestCommitRun(t *testing.T) { t.Fatal(err) } if string(output) != "hello\n" { - t.Fatalf("Unexpected output. Expected %s, received: %s (err: %s)", "hello\n", string(output), string(output2)) + t.Fatalf("Unexpected output. Expected %s, received: %s (err: %s)", "hello\n", output, output2) } } @@ -885,7 +885,7 @@ func BenchmarkRunSequencial(b *testing.B) { b.Fatal(err) } if string(output) != "foo" { - b.Fatalf("Unexecpted output: %v", string(output)) + b.Fatalf("Unexpected output: %s", output) } if err := runtime.Destroy(container); err != nil { b.Fatal(err)