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

Delta Between Two Patch Sets: src/cmd/gofix/main.go

Issue 4620049: code review 4620049: http: make Headers be source of truth (Closed)
Left Patch Set: diff -r bd35e21c471e 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_test.go ('k') | src/pkg/http/cgi/child.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. 1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package main 5 package main
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "exec" 9 "exec"
10 "flag" 10 "flag"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 file, err := parser.ParseFile(fset, filename, src, parserMode) 117 file, err := parser.ParseFile(fset, filename, src, parserMode)
118 if err != nil { 118 if err != nil {
119 return err 119 return err
120 } 120 }
121 121
122 // Apply all fixes to file. 122 // Apply all fixes to file.
123 newFile := file 123 newFile := file
124 fixed := false 124 fixed := false
125 for _, fix := range fixes { 125 for _, fix := range fixes {
126 » » if allowed != nil && !allowed[fix.desc] { 126 » » if allowed != nil && !allowed[fix.name] {
127 continue 127 continue
128 } 128 }
129 if fix.f(newFile) { 129 if fix.f(newFile) {
130 fixed = true 130 fixed = true
131 fmt.Fprintf(&fixlog, " %s", fix.name) 131 fmt.Fprintf(&fixlog, " %s", fix.name)
132 132
133 // AST changed. 133 // AST changed.
134 // Print and parse, to update any missing scoping 134 // Print and parse, to update any missing scoping
135 // or position information for subsequent fixers. 135 // or position information for subsequent fixers.
136 buf.Reset() 136 buf.Reset()
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 f2.Write(b2) 249 f2.Write(b2)
250 250
251 data, err = exec.Command("diff", "-u", f1.Name(), f2.Name()).CombinedOut put() 251 data, err = exec.Command("diff", "-u", f1.Name(), f2.Name()).CombinedOut put()
252 if len(data) > 0 { 252 if len(data) > 0 {
253 // diff exits with a non-zero status when the files don't match. 253 // diff exits with a non-zero status when the files don't match.
254 // Ignore that failure as long as we get output. 254 // Ignore that failure as long as we get output.
255 err = nil 255 err = nil
256 } 256 }
257 return 257 return
258 } 258 }
LEFTRIGHT

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