Skip to content
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

x/tools/cmd/guru: confusing behavior on source files whose package can't be located #17516

Open
alandonovan opened this issue Oct 19, 2016 · 0 comments
Labels
NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@alandonovan
Copy link
Contributor

CL 30451 caused guru to silently treat a file that it can't locate beneath $GOPATH as if it belonged to an anonymous package (actually, one named "command-line-arguments") containing just that file. The behavior is convenient for some queries since it allows you to, for instance, describe arbitrary identifiers in any Go source file. However, for "reverse" queries such as "implements", its benefits are more dubious. Although it may cause "implements" facts within that single file to be reported, guru will fail to report "implements" facts about packages that import this one, since without knowing the true name of the query package, it cannot enumerate the packages that import it.

The tool should at least issue a warning* when it does this kind of guesswork, and should perhaps not do it at all for queries that use the import graph.

*though warnings are tricky because they may interfere with structured JSON output for editors that merge subcommands' stdout and stderr.

@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 20, 2016
@quentinmit quentinmit added this to the Unreleased milestone Oct 20, 2016
@quentinmit quentinmit changed the title guru: confusing behavior on source files whose package can't be located x/tools/cmd/guru: confusing behavior on source files whose package can't be located Oct 20, 2016
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants