From 91651c1844a5c8ef02bd907aa830eb8703c098b3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A9ter=20Sur=C3=A1nyi?= Date: Wed, 7 Nov 2012 04:59:21 +0800 Subject: [PATCH] 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 --- src/cmd/godoc/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cmd/godoc/main.go b/src/cmd/godoc/main.go index b124b10ca9..02891444b0 100644 --- a/src/cmd/godoc/main.go +++ b/src/cmd/godoc/main.go @@ -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++ { -- 2.48.1