From f60d9635b16a5a57b06eaa119614ba4df421966a Mon Sep 17 00:00:00 2001 From: Chris Broadfoot Date: Wed, 3 Oct 2018 18:38:58 -0700 Subject: [PATCH] cmd/godoc: add version info for golang.org Adds version information for package docs for the production version of godoc running on golang.org. Updates golang/go#5778. Change-Id: I8b56e8152b20b34104f274263a6c0b5a0180093b Reviewed-on: https://go-review.googlesource.com/c/139557 Reviewed-by: Devon H. O'Dell Reviewed-by: Brad Fitzpatrick --- cmd/godoc/appinit.go | 1 + cmd/godoc/regtest_test.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/cmd/godoc/appinit.go b/cmd/godoc/appinit.go index 293ad52a47e..cb747b30ef2 100644 --- a/cmd/godoc/appinit.go +++ b/cmd/godoc/appinit.go @@ -83,6 +83,7 @@ func main() { log.Fatal(err) } corpus.IndexDirectory = indexDirectoryDefault + corpus.InitVersionInfo() go corpus.RunIndexer() pres = godoc.NewPresentation(corpus) diff --git a/cmd/godoc/regtest_test.go b/cmd/godoc/regtest_test.go index dcfa9154cd3..7e76017069c 100644 --- a/cmd/godoc/regtest_test.go +++ b/cmd/godoc/regtest_test.go @@ -49,6 +49,11 @@ func TestLiveServer(t *testing.T) { Path: "/pkg/os/", Substring: "func Open", }, + { + Path: "/pkg/net/http/", + Substring: `title="Added in Go 1.11"`, + Message: "version information not present - failed InitVersionInfo?", + }, { Path: "/robots.txt", Substring: "Disallow: /search",