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/go/analysis: Pass.All{Package,Object}Facts: document what "all" means #70351

Open
adonovan opened this issue Nov 14, 2024 · 0 comments
Open
Labels
Analysis Issues related to static analysis (vet, x/tools/go/analysis) Documentation 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

@adonovan
Copy link
Member

package analysis // golang.org/x/tools/go/analysis

type Pass struct {
	...
	// AllObjectFacts returns a new slice containing all object
	// facts of the analysis's FactTypes in unspecified order.
	AllObjectFacts func() []ObjectFact

What does "all" mean exactly? I think the intent is that it means the set of facts that you would get if you were to call ImportObjectFact on every types.Object that you are able to obtain from the Pass (and mutatis mutandi for s/Object/Package/g).

More generally the API is unclear as to whether Export(o, f) followed by Import(o) returns f even within the same package. I think the implementations have always done so.

@adonovan adonovan added Analysis Issues related to static analysis (vet, x/tools/go/analysis) Documentation labels Nov 14, 2024
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Nov 14, 2024
@gopherbot gopherbot added this to the Unreleased milestone Nov 14, 2024
@cherrymui cherrymui added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Analysis Issues related to static analysis (vet, x/tools/go/analysis) Documentation 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