-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/cmd/godoc: handle file name arguments better, particularly w.r.t. GOPATH #4330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Milestone
Comments
Owner changed to @adg. |
Let's spec out how the godoc command-line should work: Godoc's first non-flag argument must be one of: 1. a package import path (treated as relative to $GOROOT/src/pkg or $GOPATH/src) 2a. a command name (treated as relative to $GOROOT/src/cmd) 2b. a command name prefixed with "cmd/" (treated as relative to $GOROOT/src) 3. a relative path to a package or command (may or may not be inside $GOROOT or $GOPATH) In each of these cases, we know what to display: 1. docs for the first package found by go/build 2a. docs for the command; if there is a conflict between the command name and an import path (1) then the import path is matched first, and a warning is printed to use "godoc cmd/foo" for docs on command foo. 2b. docs for the command. 3. docs for the package or command found at that path The missing piece that is confusing Rob here is that "foo" is not equivalent to "./foo". I changed this in golang.org/cl/7132044, but Russ took issue with the change, and we settled on providing a warning if "godoc foo" is issued and the directory ./foo exists. Any opinions? |
Now that we have |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: