Don't convert []byte to string unnecessarily.

This commit is contained in:
Caleb Spare 2013-03-30 00:22:56 -07:00
Родитель 7830cf9166
Коммит 15b3088157
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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)