const Doc … var Analyzer … func run(pass *analysis.Pass) (any, error) { … } // Reduced from x/tools/gopls/internal/golang/util.go. Good enough for now. // TODO(adonovan): use ast.IsGenerated in go1.21. func isGenerated(f *ast.File) bool { … } var generatedRx … // origin returns the original uninstantiated symbol for obj. func origin(obj types.Object) types.Object { … } // TODO(adonovan): use go1.21 slices.Contains. func slicesContains[S ~[]E, E comparable](slice S, x E) bool { … }