FAQ
https://codereview.appspot.com/7132044/diff/5004/src/cmd/godoc/godoc.go
File src/cmd/godoc/godoc.go (right):

https://codereview.appspot.com/7132044/diff/5004/src/cmd/godoc/godoc.go#newcode1052
src/cmd/godoc/godoc.go:1052: // then it is not usable as command docs.
On 2013/01/22 21:46:20, rsc wrote:
This is not true. A Go command can be in package main and have docs in package
main. 'Package documentation' is a hack for commands written in C. I
don't know
if that affects the surrounding code, but the comment should be more
precise.

If isPkg is false then we're looking for doc.go with "package
documentation". I updated the comment, hopefully it is more clear.

https://codereview.appspot.com/7132044/diff/5004/src/cmd/godoc/main.go
File src/cmd/godoc/main.go (right):

https://codereview.appspot.com/7132044/diff/5004/src/cmd/godoc/main.go#newcode384
src/cmd/godoc/main.go:384: // If command docs are present, choose them
above all else.
On 2013/01/22 21:46:20, rsc wrote:
This is different from the way it used to work.
It used to be that package wins unless you say cmd/.
I think we need to nail down when to use command docs (with cmdHandler,
which does not show any type, func, var, or const declarations) and when
to use package docs (with pkgHandler).

Proposal:

Show command docs when:
a. there is a doc.go in the directory with a "package documentation"
clause
b. the files in the directory belong to "package main"
Otherwise show package docs.

I think point b is not the case at the moment.

https://codereview.appspot.com/7132044/

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedJan 23, '13 at 5:58a
activeJan 23, '13 at 5:58a
posts1
users1
websitegolang.org

1 user in discussion

Adg: 1 post

People

Translate

site design / logo © 2022 Grokbase