LEFT | RIGHT |
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 Loading... |
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 Loading... |
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 } |
LEFT | RIGHT |