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

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

Issue 4572065: code review 4572065: godoc: replace direct OS file system accesses in favor (Closed)
Left Patch Set: diff -r ecb31be11487 https://go.googlecode.com/hg/ Created 12 years, 9 months ago
Right Patch Set: diff -r d086bab9b037 https://go.googlecode.com/hg/ Created 12 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/godoc/index.go ('k') | src/cmd/godoc/mapping.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
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 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 // godoc: Go Documentation Server 5 // godoc: Go Documentation Server
6 6
7 // Web server tree: 7 // Web server tree:
8 // 8 //
9 // http://godoc/ main landing page 9 // http://godoc/ main landing page
10 // http://godoc/doc/ serve from $GOROOT/doc - spec, mem, tutorial, et c. 10 // http://godoc/doc/ serve from $GOROOT/doc - spec, mem, tutorial, et c.
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // remote search 176 // remote search
177 for _, addr := range addrs { 177 for _, addr := range addrs {
178 url := "http://" + addr + search 178 url := "http://" + addr + search
179 res, err = http.Get(url) 179 res, err = http.Get(url)
180 if err == nil && res.StatusCode == http.StatusOK { 180 if err == nil && res.StatusCode == http.StatusOK {
181 break 181 break
182 } 182 }
183 } 183 }
184 184
185 if err == nil && res.StatusCode != http.StatusOK { 185 if err == nil && res.StatusCode != http.StatusOK {
186 » » err = os.ErrorString(res.Status) 186 » » err = os.NewError(res.Status)
187 } 187 }
188 188
189 return 189 return
190 } 190 }
191 191
192 192
193 // Does s look like a regular expression? 193 // Does s look like a regular expression?
194 func isRegexp(s string) bool { 194 func isRegexp(s string) bool {
195 return strings.IndexAny(s, ".(|)*+?^$[]") >= 0 195 return strings.IndexAny(s, ".(|)*+?^$[]") >= 0
196 } 196 }
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 397
398 case info.PDoc != nil: 398 case info.PDoc != nil:
399 info.PDoc.Filter(filter) 399 info.PDoc.Filter(filter)
400 } 400 }
401 } 401 }
402 402
403 if err := packageText.Execute(os.Stdout, info); err != nil { 403 if err := packageText.Execute(os.Stdout, info); err != nil {
404 log.Printf("packageText.Execute: %s", err) 404 log.Printf("packageText.Execute: %s", err)
405 } 405 }
406 } 406 }
LEFTRIGHT

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