// 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 returns true if there are any top-level declarations
// left after filtering; it returns false otherwise.
//

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 returns true if there are any top-level declarations
left after filtering; it returns false otherwise.
// 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 returns true if there are any top - level declarations // left after filtering ; it returns false otherwise . //
func FilterPackage(pkg *Package, f Filter) bool {
	hasDecls := false
	for _, src := range pkg.Files {
		if FilterFile(src, f) {
			hasDecls = true
		}
	}
	return hasDecls
}
func FilterPackage ( pkg * Package , f Filter ) bool { hasDecls := false for _ , src := range pkg . Files { if FilterFile ( src , f ) { hasDecls = true } } return hasDecls }
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.
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 .