FilterPackage trims the AST for a Go package in place by removing all names from top-level declarations (including struct field and interface method names, but not from parameter lists) that don't pass through the filter f. If the declaration is empty afterwards, the declaration is removed from the AST. The pkg.Files list is not changed, so that file names and top-level package comments don't get lost.
FilterPackage reports whether there are any top-level declarations left after filtering.
FilterPackage is referenced in 2 repositoriesgithub.com/rocky/go-fish
- 1 reference in repl_imports.go
- 1 reference in goapi/full/wrap.go