You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
alandonovan opened this issue
Oct 19, 2016
· 1 comment
Labels
NeedsFixThe path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.
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.
The text was updated successfully, but these errors were encountered:
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
added
the
Tools
This label describes issues relating to any tools in the x/tools repository.
label
Sep 12, 2019
NeedsFixThe path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.
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.
The text was updated successfully, but these errors were encountered: