I am happy with where this is going, just want to try to clean up the
logic.
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.
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.
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.
This is different from the way it used to work.
It used to be that package wins unless you say cmd/.
https://codereview.appspot.com/7132044/diff/5004/src/cmd/godoc/main.go#newcode406
src/cmd/godoc/main.go:406: fmt.Printf("use 'godoc %s%s' for
documentation on the %s command \n\n", cmdPrefix, relpath, relpath)
How does this work anymore without forceCmd?
I'm pretty lost at this point in the code. Can you make this clearer?
https://codereview.appspot.com/7132044/