mirror of
https://github.com/golang/go
synced 2024-11-20 05:14:41 -07:00
cmd/godoc: initialize filesystem and metadata for -url
Unlike when using -http, godoc -url didn't initialize the "filesystem" and metadata that are used when generating responses. This CL adds this initialization, so that -url provides the same results as an HTTP request when using -http. Fixes #4335. R=golang-dev, minux.ma CC=golang-dev https://golang.org/cl/6817075
This commit is contained in:
parent
d098bffd84
commit
91651c1844
@ -225,6 +225,8 @@ func main() {
|
|||||||
// Print content that would be served at the URL *urlFlag.
|
// Print content that would be served at the URL *urlFlag.
|
||||||
if *urlFlag != "" {
|
if *urlFlag != "" {
|
||||||
registerPublicHandlers(http.DefaultServeMux)
|
registerPublicHandlers(http.DefaultServeMux)
|
||||||
|
initFSTree()
|
||||||
|
updateMetadata()
|
||||||
// Try up to 10 fetches, following redirects.
|
// Try up to 10 fetches, following redirects.
|
||||||
urlstr := *urlFlag
|
urlstr := *urlFlag
|
||||||
for i := 0; i < 10; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
|
Loading…
Reference in New Issue
Block a user