// FilterFile trims the AST for a Go file 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 File.comments list is not changed.
//
// FilterFile returns true if there are any top-level declarations
// left after filtering; it returns false otherwise.
//

FilterFile trims the AST for a Go file 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 File.comments list is not changed.

FilterFile returns true if there are any top-level declarations
left after filtering; it returns false otherwise.
// FilterFile trims the AST for a Go file 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 File . comments list is not changed . // // FilterFile returns true if there are any top - level declarations // left after filtering ; it returns false otherwise . //
func FilterFile(src *File, f Filter) bool {
	j := 0
	for _, d := range src.Decls {
		if FilterDecl(d, f) {
			src.Decls[j] = d
			j++
		}
	}
	src.Decls = src.Decls[0:j]
	return j > 0
}
func FilterFile ( src * File , f Filter ) bool { j := 0 for _ , d := range src . Decls { if FilterDecl ( d , f ) { src . Decls [ j ] = d j ++ } } src . Decls = src . Decls [ 0 : j ] return j > 0 }
FilterFile trims the AST for a Go file 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.
FilterFile trims the AST for a Go file 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 .