]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: gofmt -w -s
authorMikio Hara <mikioh.mikioh@gmail.com>
Wed, 26 Oct 2016 17:58:09 +0000 (02:58 +0900)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 26 Oct 2016 18:24:08 +0000 (18:24 +0000)
Change-Id: I6815a8560dd9fe0a0ebd485a0693f7044ba09848
Reviewed-on: https://go-review.googlesource.com/32137
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/net/http/client_test.go

index c86ae19c8659d5d04ad848fb633c8fc08c09e490..369a50ded69346749fb6063d77afe99db03a9959 100644 (file)
@@ -1315,21 +1315,21 @@ func TestClientAltersCookiesOnRedirect(t *testing.T) {
                switch c.Value {
                case "0":
                        want = map[string][]string{
-                               "Cookie1": []string{"OldValue1a", "OldValue1b"},
-                               "Cookie2": []string{"OldValue2"},
-                               "Cookie3": []string{"OldValue3a", "OldValue3b"},
-                               "Cookie4": []string{"OldValue4"},
-                               "Cycle":   []string{"0"},
+                               "Cookie1": {"OldValue1a", "OldValue1b"},
+                               "Cookie2": {"OldValue2"},
+                               "Cookie3": {"OldValue3a", "OldValue3b"},
+                               "Cookie4": {"OldValue4"},
+                               "Cycle":   {"0"},
                        }
                        SetCookie(w, &Cookie{Name: "Cycle", Value: "1", Path: "/"})
                        SetCookie(w, &Cookie{Name: "Cookie2", Path: "/", MaxAge: -1}) // Delete cookie from Header
                        Redirect(w, r, "/", StatusFound)
                case "1":
                        want = map[string][]string{
-                               "Cookie1": []string{"OldValue1a", "OldValue1b"},
-                               "Cookie3": []string{"OldValue3a", "OldValue3b"},
-                               "Cookie4": []string{"OldValue4"},
-                               "Cycle":   []string{"1"},
+                               "Cookie1": {"OldValue1a", "OldValue1b"},
+                               "Cookie3": {"OldValue3a", "OldValue3b"},
+                               "Cookie4": {"OldValue4"},
+                               "Cycle":   {"1"},
                        }
                        SetCookie(w, &Cookie{Name: "Cycle", Value: "2", Path: "/"})
                        SetCookie(w, &Cookie{Name: "Cookie3", Value: "NewValue3", Path: "/"}) // Modify cookie in Header
@@ -1337,21 +1337,21 @@ func TestClientAltersCookiesOnRedirect(t *testing.T) {
                        Redirect(w, r, "/", StatusFound)
                case "2":
                        want = map[string][]string{
-                               "Cookie1": []string{"OldValue1a", "OldValue1b"},
-                               "Cookie3": []string{"NewValue3"},
-                               "Cookie4": []string{"NewValue4"},
-                               "Cycle":   []string{"2"},
+                               "Cookie1": {"OldValue1a", "OldValue1b"},
+                               "Cookie3": {"NewValue3"},
+                               "Cookie4": {"NewValue4"},
+                               "Cycle":   {"2"},
                        }
                        SetCookie(w, &Cookie{Name: "Cycle", Value: "3", Path: "/"})
                        SetCookie(w, &Cookie{Name: "Cookie5", Value: "NewValue5", Path: "/"}) // Insert cookie into Jar
                        Redirect(w, r, "/", StatusFound)
                case "3":
                        want = map[string][]string{
-                               "Cookie1": []string{"OldValue1a", "OldValue1b"},
-                               "Cookie3": []string{"NewValue3"},
-                               "Cookie4": []string{"NewValue4"},
-                               "Cookie5": []string{"NewValue5"},
-                               "Cycle":   []string{"3"},
+                               "Cookie1": {"OldValue1a", "OldValue1b"},
+                               "Cookie3": {"NewValue3"},
+                               "Cookie4": {"NewValue4"},
+                               "Cookie5": {"NewValue5"},
+                               "Cycle":   {"3"},
                        }
                        // Don't redirect to ensure the loop ends.
                default:
@@ -1380,8 +1380,8 @@ func TestClientAltersCookiesOnRedirect(t *testing.T) {
        req.AddCookie(&Cookie{Name: "Cookie2", Value: "OldValue2"})
        req.AddCookie(&Cookie{Name: "Cookie3", Value: "OldValue3a"})
        req.AddCookie(&Cookie{Name: "Cookie3", Value: "OldValue3b"})
-       jar.SetCookies(u, []*Cookie{&Cookie{Name: "Cookie4", Value: "OldValue4", Path: "/"}})
-       jar.SetCookies(u, []*Cookie{&Cookie{Name: "Cycle", Value: "0", Path: "/"}})
+       jar.SetCookies(u, []*Cookie{{Name: "Cookie4", Value: "OldValue4", Path: "/"}})
+       jar.SetCookies(u, []*Cookie{{Name: "Cycle", Value: "0", Path: "/"}})
        res, err := c.Do(req)
        if err != nil {
                t.Fatal(err)