From 17ad00a35e3cafc7e9386eb4c6522630a886c29f Mon Sep 17 00:00:00 2001 From: shin- Date: Fri, 10 May 2013 08:52:25 -0700 Subject: [PATCH] gofmt pass --- auth/auth_test.go | 8 ++++---- registry.go | 1 - registry_test.go | 14 +++++++------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/auth/auth_test.go b/auth/auth_test.go index 0e8bec2fcc..6c8d032cf7 100644 --- a/auth/auth_test.go +++ b/auth/auth_test.go @@ -26,7 +26,7 @@ func TestEncodeAuth(t *testing.T) { } } -func TestLogin(t* testing.T) { +func TestLogin(t *testing.T) { os.Setenv("DOCKER_INDEX_URL", "https://indexstaging-docker.dotcloud.com") defer os.Setenv("DOCKER_INDEX_URL", "") authConfig := NewAuthConfig("unittester", "surlautrerivejetattendrai", "noise+unittester@dotcloud.com", "/tmp") @@ -39,7 +39,7 @@ func TestLogin(t* testing.T) { } } -func TestCreateAccount(t* testing.T) { +func TestCreateAccount(t *testing.T) { os.Setenv("DOCKER_INDEX_URL", "https://indexstaging-docker.dotcloud.com") defer os.Setenv("DOCKER_INDEX_URL", "") tokenBuffer := make([]byte, 16) @@ -49,7 +49,7 @@ func TestCreateAccount(t* testing.T) { } token := hex.EncodeToString(tokenBuffer)[:12] username := "ut" + token - authConfig := NewAuthConfig(username, "test42", "docker-ut+" + token + "@example.com", "/tmp") + authConfig := NewAuthConfig(username, "test42", "docker-ut+"+token+"@example.com", "/tmp") status, err := Login(authConfig) if err != nil { t.Fatal(err) @@ -70,4 +70,4 @@ func TestCreateAccount(t* testing.T) { if !strings.Contains(err.Error(), expectedError) { t.Fatalf("Expected message \"%s\" but found \"%s\" instead", expectedError, err.Error()) } -} \ No newline at end of file +} diff --git a/registry.go b/registry.go index 2a997a1dd7..d451551297 100644 --- a/registry.go +++ b/registry.go @@ -691,7 +691,6 @@ func (graph *Graph) PushRepository(stdout io.Writer, remote string, localRepo Re } } - req2, err := http.NewRequest("PUT", auth.IndexServerAddress()+"/repositories/"+remote+"/images", bytes.NewReader(imgListJson)) if err != nil { return err diff --git a/registry_test.go b/registry_test.go index bc558d9a53..5b960c0d95 100644 --- a/registry_test.go +++ b/registry_test.go @@ -9,7 +9,7 @@ import ( "testing" ) -func TestPull(t* testing.T) { +func TestPull(t *testing.T) { runtime, err := newTestRuntime() if err != nil { t.Fatal(err) @@ -45,7 +45,7 @@ func TestPull(t* testing.T) { } } -func TestPullTag(t* testing.T) { +func TestPullTag(t *testing.T) { runtime, err := newTestRuntime() if err != nil { t.Fatal(err) @@ -74,7 +74,7 @@ func login(runtime *Runtime) error { return err } -func TestPush(t* testing.T) { +func TestPush(t *testing.T) { os.Setenv("DOCKER_INDEX_URL", "https://indexstaging-docker.dotcloud.com") defer os.Setenv("DOCKER_INDEX_URL", "") runtime, err := newTestRuntime() @@ -116,13 +116,13 @@ func TestPush(t* testing.T) { t.Fatalf("Expected status code 0, found %d instead", status) } - img, err := b.Commit(container, "unittester/" + token, "", "", "", nil) + img, err := b.Commit(container, "unittester/"+token, "", "", "", nil) if err != nil { t.Fatal(err) } repo := runtime.repositories.Repositories["unittester/"+token] - err = runtime.graph.PushRepository(os.Stdout, "unittester/" + token, repo, runtime.authConfig) + err = runtime.graph.PushRepository(os.Stdout, "unittester/"+token, repo, runtime.authConfig) if err != nil { t.Fatal(err) } @@ -132,7 +132,7 @@ func TestPush(t* testing.T) { t.Fatal(err) } - err = runtime.graph.PullRepository(os.Stdout, "unittester/" + token, "", runtime.repositories, runtime.authConfig) + err = runtime.graph.PullRepository(os.Stdout, "unittester/"+token, "", runtime.repositories, runtime.authConfig) if err != nil { t.Fatal(err) } @@ -145,4 +145,4 @@ func TestPush(t* testing.T) { if _, err := os.Stat(path.Join(layerPath, token)); err != nil { t.Fatalf("Error while trying to retrieve token file: %v", err) } -} \ No newline at end of file +}