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
Match string // command-line patterns matching this package
DepOnly bool // package is only a dependency, not explicitly listed
It's not clear whether packages built on behalf of tests "match" the pattern, but the output seems clearly inconsistent in some ways:
Given that context.test has DepOnly == false, that implies cmd/go does think of context.test as "explicitly listed" by ./.... It also clearly thinks of, say, net as "explicitly listed" by ./.... So it seems odd that net [context.test] (and several others) have DepOnly == true, indicating that they're not "explicitly listed".
Based on the documentation, I would expect that, if DepOnly == true, then it's "not explicitly listed", so Match should be empty because it didn't match any patterns. And if DepOnly == false, then it is "explicitly listed", and Match should list at least one pattern. For example, context.test is "explicitly listed", yet cmd/go can't tell me what pattern it matched.
What did you see instead?
DepOnly is true for some of these and false for others in ways I can't rationalize.
For some packages, DepOnly == true, but a Match pattern is also listed.
For some packages, DepOnly == false, but a Match pattern is listed.
The text was updated successfully, but these errors were encountered:
rf only modifies files in the current module, but it has to load
imported modules for type checking, so it records on every package
whether it's in the current module or not. However, currently, it uses
the DepOnly field from "go list" to determine this. It's true that if
.DepOnly is false, then it's in the current module, but there are
various conditions under which .DepOnly is true and the package is
still in the current module (these conditions may not always be right,
but they're complicated regardless; see golang/go#60794).
Inside of using .DepOnly, use .Module.Version, which is nil for
anything in the current workspace, and thus much more closely matches
the semantics of "can we edit this?"