Delta Between Two Patch Sets: src/cmd/gofix/httpheaders_test.go
Issue 4620049 :
code review 4620049: http: make Headers be source of truth (Closed)
Left Patch Set: diff -r d086bab9b037 https://go.googlecode.com/hg
Right Patch Set: diff -r f5d2325ee229 https://go.googlecode.com/hg
Use n/p to move between diff chunks;
N/P to move between comments.
Please Sign in to add in-line comments.
Jump to:
src/cmd/gofix/Makefile
src/cmd/gofix/httpheaders.go
src/cmd/gofix/httpheaders_test.go
src/cmd/gofix/main.go
src/pkg/http/cgi/child.go
src/pkg/http/cgi/child_test.go
src/pkg/http/cgi/host.go
src/pkg/http/client.go
src/pkg/http/client_test.go
src/pkg/http/cookie.go
src/pkg/http/cookie_test.go
src/pkg/http/readrequest_test.go
src/pkg/http/request.go
src/pkg/http/requestwrite_test.go
src/pkg/http/response.go
src/pkg/http/reverseproxy.go
src/pkg/http/reverseproxy_test.go
src/pkg/http/server.go
LEFT RIGHT
(no file at all) 1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package main
6
7 func init() {
8 addTestCases(httpHeadersTests)
9 }
10
11 var httpHeadersTests = []testCase{
12 {
13 Name: "httpheaders.0",
14 In: `package headertest
15
16 import (
17 "http"
18 )
19
20 type Other struct {
21 Referer string
22 UserAgent string
23 Cookie []*http.Cookie
24 }
25
26 func f(req *http.Request, res *http.Response, other *Other) {
27 _ = req.Referer
28 _ = req.UserAgent
29 _ = req.Cookie
30
31 _ = res.Cookie
32
33 _ = other.Referer
34 _ = other.UserAgent
35 _ = other.Cookie
36
37 _ = req.Referer()
38 _ = req.UserAgent()
39 _ = req.Cookies()
40 _ = res.Cookies()
41 }
42 `,
43 Out: `package headertest
44
45 import (
46 "http"
47 )
48
49 type Other struct {
50 Referer string
51 UserAgent string
52 Cookie []*http.Cookie
53 }
54
55 func f(req *http.Request, res *http.Response, other *Other) {
56 _ = req.Referer()
57 _ = req.UserAgent()
58 _ = req.Cookies()
59
60 _ = res.Cookies()
61
62 _ = other.Referer
63 _ = other.UserAgent
64 _ = other.Cookie
65
66 _ = req.Referer()
67 _ = req.UserAgent()
68 _ = req.Cookies()
69 _ = res.Cookies()
70 }
71 `,
72 },
73 }
LEFT RIGHT