| 575 | } |
| 576 | |
| 577 | func (j *Importer) filterReferences(classes []*Class, refs *importers.References, funcRefs map[funcRef]struct{}) { |
| 578 | for _, cls := range classes { |
| 579 | var filtered []*FuncSet |
| 580 | for _, f := range cls.Funcs { |
| 581 | if _, exists := funcRefs[funcRef{cls.Name, f.GoName}]; exists { |
| 582 | filtered = append(filtered, f) |
| 583 | } |
| 584 | } |
| 585 | cls.Funcs = filtered |
| 586 | filtered = nil |
| 587 | for _, m := range cls.Methods { |
| 588 | if _, exists := refs.Names[m.GoName]; exists { |
| 589 | filtered = append(filtered, m) |
| 590 | } |
| 591 | } |
| 592 | cls.Methods = filtered |
| 593 | } |
| 594 | } |
| 595 | |
| 596 | // importClasses imports the named classes from the classpaths of the Importer. |
| 597 | func (j *Importer) importClasses(names []string, allowMissingClasses bool) ([]*Class, error) { |