godoc: documentation of -analysis features.
The text and images are "baked in" to the godoc executable's
rodata section (~300KB) and are accessible from the godoc
server itself at /lib/godoc/analysis/help.html.
In due course, the page will become visible at
http://golang.org/lib/godoc/analysis/help.html, which will be
the canonical location for this doc (in announcements, etc).
The page is temporarily visible here, for those on the Google corp network:
http://172.26.104.127:7777/lib/godoc/analysis/help.html
Also:
- add link to new doc from source view pages.
- document -analysis flag in cmd/godoc/doc.go
- fix indentation of -analysis flag's help string
LGTM=gri
R=gri, bgarcia, r
CC=golang-codereviews
https://golang.org/cl/87110045
diff --git a/godoc/server.go b/godoc/server.go
index 8e273c2..76fc48b 100644
--- a/godoc/server.go
+++ b/godoc/server.go
@@ -506,6 +506,13 @@
buf.Write(marshalJSON(data))
buf.WriteString(";</script>\n")
+ // TODO(adonovan): indicate whether analysis is
+ // disabled, pending, completed or failed.
+ // For now, display help link only if 'completed'.
+ if links != nil {
+ buf.WriteString("<a href='/lib/godoc/analysis/help.html'>Static analysis features</a><br/>")
+ }
+
buf.WriteString("<pre>")
formatGoSource(&buf, src, links, h, s)
buf.WriteString("</pre>")