summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2013-02-19 11:19:58 -0800
committerRobert Griesemer <gri@golang.org>2013-02-19 11:19:58 -0800
commit3ee87d02b063e368259486d83e4ea391538f84c2 (patch)
treefe4143f4630b68b5dedcf73163fde1fb3740af7d /lib
parent04567299771d99206101e3273b1851518cad491a (diff)
downloadgo-git-3ee87d02b063e368259486d83e4ea391538f84c2.tar.gz
cmd/godoc: use go/build to determine package and example files
Also: - faster code for example extraction - simplify handling of command documentation: all "main" packages are treated as commands - various minor cleanups along the way For commands written in Go, any doc.go file containing documentation must now be part of package main (rather then package documentation), otherwise the documentation won't show up in godoc (it will still build, though). For commands written in C, documentation may still be in doc.go files defining package documentation, but the recommended way is to explicitly ignore those files with a +build ignore constraint to define package main. Fixes #4806. R=adg, rsc, dave, bradfitz CC=golang-dev https://golang.org/cl/7333046
Diffstat (limited to 'lib')
-rw-r--r--lib/godoc/package.html2
-rw-r--r--lib/godoc/package.txt2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/godoc/package.html b/lib/godoc/package.html
index cff91fa226..85c737ec3a 100644
--- a/lib/godoc/package.html
+++ b/lib/godoc/package.html
@@ -10,7 +10,7 @@
correspond to Go identifiers).
-->
{{with .PDoc}}
- {{if $.IsPkg}}
+ {{if not $.IsMain}}
<div id="short-nav">
<dl>
<dd><code>import "{{html .ImportPath}}"</code></dd>
diff --git a/lib/godoc/package.txt b/lib/godoc/package.txt
index 12964b0010..16678d5f01 100644
--- a/lib/godoc/package.txt
+++ b/lib/godoc/package.txt
@@ -2,7 +2,7 @@
---------------------------------------
-*/}}{{with .PDoc}}{{if $.IsPkg}}PACKAGE
+*/}}{{with .PDoc}}{{if not $.IsMain}}PACKAGE
package {{.Name}}
import "{{.ImportPath}}"