-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/cmd/godoc: godoc suggests using arguments it doesn't understand when confused by vendoring #45126
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
Are you using golang.org/x/tools/cmd/godoc ? What version are you using? Thanks. |
cc @dmitshur |
I'm using the version installed by running |
The |
As far as I can tell godoc is doing the right thing, it is reporting that it "failed to determine if vendoring is enabled" and provides stderr output from cmd/go to provide more context (without that context, it would be very hard to understand why it failed). It goes poorly because the cmd/go stderr output includes advice that's meant to be helpful when a human runs cmd/go directly, but is misleading when another tool runs cmd/go. Perhaps it makes sense to file a cmd/go feature request issue to see if there's a way to invoke cmd/go in a way that doesn't include its human-facing advice. Otherwise, godoc has to either not include the details (cmd/go's stderr) when saying that it failed to determine if vendoring is enabled, or try to do work itself to filter out advice that isn't directly applicable. @jayconrod Any thoughts or preferences on this? Have there been requests from authors of other tools (that need to run cmd/go internally) to be able to omit its human-facing advice? |
#30134 is an issue for machine-readable error codes in cmd/go messages. I don't think it's likely to be fixed soon though. Maybe godoc could make it clearer this output is coming from the go command, and specifically, what command was run? At least the advice to run |
I also don't really understand why godoc needs to look at vendored dependencies. I mean, I'm not expecting to read the documentation for those, just for my project. |
godoc serves documentation for all packages in the build list, which includes packages in the main module as well as dependencies. It follows the logic of the go command and uses automatic vendoring (see #35429). Hopefully the inconsistent vendoring problem is rare. If someone runs into it, it means the normal go command cannot build code either. Let me know if that's not the case.
This seems like a good solution. I don't see much else that can be done. |
Change https://golang.org/cl/303529 mentions this issue: |
I can confirm this when running |
@matttproud that is unrelated and you should be using the |
cmd/godoc was deprecated. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
However:
The text was updated successfully, but these errors were encountered: