// filterIdentList removes unexported names from list in place // and returns the resulting list. func filterIdentList(list []*ast.Ident) []*ast.Ident { … } var underscore … func filterCompositeLit(lit *ast.CompositeLit, filter Filter, export bool) { … } func filterExprList(list []ast.Expr, filter Filter, export bool) []ast.Expr { … } // updateIdentList replaces all unexported identifiers with underscore // and reports whether at least one exported name exists. func updateIdentList(list []*ast.Ident) (hasExported bool) { … } // hasExportedName reports whether list contains any exported names. func hasExportedName(list []*ast.Ident) bool { … } // removeAnonymousField removes anonymous fields named name from an interface. func removeAnonymousField(name string, ityp *ast.InterfaceType) { … } // filterFieldList removes unexported fields (field names) from the field list // in place and reports whether fields were removed. Anonymous fields are // recorded with the parent type. filterType is called with the types of // all remaining fields. func (r *reader) filterFieldList(parent *namedType, fields *ast.FieldList, ityp *ast.InterfaceType) (removedFields bool) { … } // filterParamList applies filterType to each parameter type in fields. func (r *reader) filterParamList(fields *ast.FieldList) { … } // filterType strips any unexported struct fields or method types from typ // in place. If fields (or methods) have been removed, the corresponding // struct or interface type has the Incomplete field set to true. func (r *reader) filterType(parent *namedType, typ ast.Expr) { … } func (r *reader) filterSpec(spec ast.Spec) bool { … } // copyConstType returns a copy of typ with position pos. // typ must be a valid constant type. // In practice, only (possibly qualified) identifiers are possible. func copyConstType(typ ast.Expr, pos token.Pos) ast.Expr { … } func (r *reader) filterSpecList(list []ast.Spec, tok token.Token) []ast.Spec { … } func (r *reader) filterDecl(decl ast.Decl) bool { … } // fileExports removes unexported declarations from src in place. func (r *reader) fileExports(src *ast.File) { … }