]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/godoc: initialize filesystem and metadata for -url
authorPéter Surányi <speter.go1@gmail.com>
Tue, 6 Nov 2012 20:59:21 +0000 (04:59 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Tue, 6 Nov 2012 20:59:21 +0000 (04:59 +0800)
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

index b124b10ca9c378d4a653916829c705bc17b3836d..02891444b0f2dd7f397f4fceb034b5848bdca2f1 100644 (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++ {