diff --git a/cmd/godoc/main.go b/cmd/godoc/main.go index 6c21e66b..46938734 100644 --- a/cmd/godoc/main.go +++ b/cmd/godoc/main.go @@ -221,6 +221,7 @@ func main() { corpus.IndexThrottle = *indexThrottle if *writeIndex { corpus.IndexThrottle = 1.0 + corpus.IndexEnabled = true } if *writeIndex || httpMode || *urlFlag != "" { if err := corpus.Init(); err != nil { diff --git a/godoc/index.go b/godoc/index.go index eb5182de..efccd64c 100644 --- a/godoc/index.go +++ b/godoc/index.go @@ -1477,10 +1477,11 @@ func (c *Corpus) UpdateIndex() { func (c *Corpus) RunIndexer() { // initialize the index from disk if possible if c.IndexFiles != "" { + c.initFSTree() if err := c.readIndex(c.IndexFiles); err != nil { log.Printf("error reading index from file %s: %v", c.IndexFiles, err) - return } + return } // Repeatedly update the package directory tree and index.