// FilterDecl trims the AST for a Go declaration in place by removing
// all names (including struct field and interface method names, but
// not from parameter lists) that don't pass through the filter f.
//
// FilterDecl returns true if there are any declared names left after
// filtering; it returns false otherwise.
//

FilterDecl trims the AST for a Go declaration in place by removing
all names (including struct field and interface method names, but
not from parameter lists) that don't pass through the filter f.

FilterDecl returns true if there are any declared names left after
filtering; it returns false otherwise.
// FilterDecl trims the AST for a Go declaration in place by removing // all names ( including struct field and interface method names but // not from parameter lists ) that don ' t pass through the filter f . // // FilterDecl returns true if there are any declared names left after // filtering ; it returns false otherwise . //
func FilterDecl(decl Decl, f Filter) bool {
	switch d := decl.(type) {
	case *GenDecl:
		d.Specs = filterSpecList(d.Specs, f)
		return len(d.Specs) > 0
	case *FuncDecl:
		return f(d.Name.Name)
	}
	return false
}
func FilterDecl ( decl Decl , f Filter ) bool { switch d := decl . ( type ) { case * GenDecl : d . Specs = filterSpecList ( d . Specs , f ) return len ( d . Specs ) > 0 case * FuncDecl : return f ( d . Name . Name ) } return false }
FilterDecl trims the AST for a Go declaration in place by removing
all names (including struct field and interface method names, but
not from parameter lists) that don't pass through the filter f.
FilterDecl trims the AST for a Go declaration in place by removing all names ( including struct field and interface method names but not from parameter lists ) that don ' t pass through the filter f .