Browse Source

Don't convert []byte to string unnecessarily.

Caleb Spare 12 years ago
parent
commit
15b3088157
2 changed files with 4 additions and 4 deletions
  1. 2 2
      auth/auth.go
  2. 2 2
      container_test.go

+ 2 - 2
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 {

+ 2 - 2
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)