1
0
mirror of https://github.com/golang/go synced 2024-11-20 03:04:40 -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:
Péter Surányi 2012-11-07 04:59:21 +08:00 committed by Shenghou Ma
parent d098bffd84
commit 91651c1844

View File

@ -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++ {