-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/doc: do not respect relative import paths that match standard commands #16183
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
Comments
I don't know if this information is relevant here or not, but I'll share it in case it is.
That may or may not be related to this bug. Note that this doesn't validate the behavior. It's still a bug in the |
Quick question - You mention the It's interesting because if I do Whereas, if I do On a different note - the godoc command line package search code is very hairy. As is relevant from the CLs trying to solve this issue #14447. I plan to take a look at the bugs affecting godoc command line, but first I would like to have a better understanding of things. |
Sorry, I've edited my original issue to make it more clear and specific.
They are two different commands:
Check your If you want to see more details, expand the compressed section below. More DetailsFor each release of Go (e.g., 1.9, 1.9.1, 1.10, etc.), a version of the When you use When you use go/src/cmd/go/internal/doc/doc.go Lines 121 to 123 in cd037bc
|
Thanks. Yes, I was looking at So it looks like the fix needs to be applied to 2 separate repos. It's interesting that the same bug got manifested in 2 different repos. |
Removing godoc, now that CLI support is gone. |
This seems to be fixed now from 1.11 onwards. Closing. |
Both the
doc
(typically invoked viago doc
)andcommands are affected.godoc
(Edit: This no longer applies to
x/tools/cmd/godoc
because it's CLI support is removed in #25443.)go doc
andcommands will always print docs forgodoc
cmd/go
command even if you provide a relative import path like./cmd/go
that may resolve to another Go package (or no package).go list ./cmd/go
works as expected.This affects
go doc ./cmd/gofmt
and other similar queries too.What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?What did you do?
What did you expect to see?
Or documentation for the actual package resolved by
go list ./cmd/go
, if it exists.What did you see instead?
Documentation for
cmd/go
showed up, as if I had typedgo doc cmd/go
(note without the relative path).The text was updated successfully, but these errors were encountered: