Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(811)

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 Created 13 years, 9 months ago
Right Patch Set: diff -r f5d2325ee229 https://go.googlecode.com/hg Created 13 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/gofix/httpheaders.go ('k') | src/cmd/gofix/main.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(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 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b