Commit 91651c18 authored by Péter Surányi's avatar Péter Surányi Committed by Shenghou Ma

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
parent d098bffd
......@@ -225,6 +225,8 @@ func main() {
// Print content that would be served at the URL *urlFlag.
if *urlFlag != "" {
registerPublicHandlers(http.DefaultServeMux)
initFSTree()
updateMetadata()
// Try up to 10 fetches, following redirects.
urlstr := *urlFlag
for i := 0; i < 10; i++ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment