mirror of
https://github.com/golang/go
synced 2024-11-13 18:50:24 -07:00
godoc: initialize vars depending on flags after parsing the flags.
R=rsc CC=golang-dev https://golang.org/cl/206109
This commit is contained in:
parent
ffd0961313
commit
ca075494a6
@ -111,10 +111,12 @@ func init() {
|
||||
flag.StringVar(&cmdroot, "cmdroot", pathutil.Join(goroot, "src/cmd"), "command source directory")
|
||||
flag.StringVar(&pkgroot, "pkgroot", pathutil.Join(goroot, "src/pkg"), "package source directory")
|
||||
flag.StringVar(&tmplroot, "tmplroot", pathutil.Join(goroot, "lib/godoc"), "template directory")
|
||||
}
|
||||
|
||||
|
||||
func initHandlers() {
|
||||
fsMap.Init(*path)
|
||||
fileServer = http.FileServer(goroot, "")
|
||||
|
||||
cmdHandler = httpHandler{"/cmd/", cmdroot, false}
|
||||
pkgHandler = httpHandler{"/pkg/", pkgroot, true}
|
||||
}
|
||||
|
@ -152,6 +152,7 @@ func main() {
|
||||
log.Exitf("negative tabwidth %d", *tabwidth)
|
||||
}
|
||||
|
||||
initHandlers()
|
||||
readTemplates()
|
||||
|
||||
if *httpaddr != "" {
|
||||
|
Loading…
Reference in New Issue
Block a user