diff options
author | Robert Griesemer <gri@golang.org> | 2013-02-19 11:19:58 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2013-02-19 11:19:58 -0800 |
commit | 3ee87d02b063e368259486d83e4ea391538f84c2 (patch) | |
tree | fe4143f4630b68b5dedcf73163fde1fb3740af7d /lib | |
parent | 04567299771d99206101e3273b1851518cad491a (diff) | |
download | go-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.html | 2 | ||||
-rw-r--r-- | lib/godoc/package.txt | 2 |
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}}" |