From ffd0961313423d51bddf2fa46a384fd3a13e3fe8 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 16 Feb 2010 11:54:12 -0800 Subject: [PATCH] godoc: fix initialization issue R=rsc CC=golang-dev https://golang.org/cl/207111 --- src/cmd/godoc/godoc.go | 2 +- src/cmd/godoc/main.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cmd/godoc/godoc.go b/src/cmd/godoc/godoc.go index 9cc194435e5..176e33949fa 100644 --- a/src/cmd/godoc/godoc.go +++ b/src/cmd/godoc/godoc.go @@ -100,7 +100,7 @@ var ( ) -func initRoots() { +func init() { goroot = os.Getenv("GOROOT") if goroot == "" { goroot = pathutil.Join(os.Getenv("HOME"), "go") diff --git a/src/cmd/godoc/main.go b/src/cmd/godoc/main.go index ef08551ce7e..4bff23f0dfd 100644 --- a/src/cmd/godoc/main.go +++ b/src/cmd/godoc/main.go @@ -152,7 +152,6 @@ func main() { log.Exitf("negative tabwidth %d", *tabwidth) } - initRoots() readTemplates() if *httpaddr != "" {