From d3c6139142f2181b42a21db02903fafea6215674 Mon Sep 17 00:00:00 2001 From: Chris Broadfoot Date: Thu, 11 Oct 2018 15:56:43 -0700 Subject: [PATCH] cmd/godoc: synchronously init corpus for index mode The corpus needs to be init'd before generating the index. Regression caused by CL 141397. Updates golang/go#25443. Change-Id: I04d19bf5d279031cc8ddf0f850d81eb06fc5efa8 Reviewed-on: https://go-review.googlesource.com/c/141717 Run-TryBot: Chris Broadfoot Reviewed-by: Brad Fitzpatrick --- cmd/godoc/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/godoc/main.go b/cmd/godoc/main.go index 5d633877..65843dd4 100644 --- a/cmd/godoc/main.go +++ b/cmd/godoc/main.go @@ -241,8 +241,10 @@ func main() { if *writeIndex { corpus.IndexThrottle = 1.0 corpus.IndexEnabled = true + initCorpus(corpus) + } else { + go initCorpus(corpus) } - go initCorpus(corpus) // Initialize the version info before readTemplates, which saves // the map value in a method value.