@@ -25,7 +25,7 @@ type InterfaceSpecificationParam struct {
2525 ParamType string
2626}
2727
28- func FindAllInterfaces (p * ast .Package , pattern string ) []InterfaceSpecification {
28+ func FindAllInterfaces (p * pkg .Package , pattern string ) []InterfaceSpecification {
2929 // Filter interfaces from all the declarations
3030 interfaces := []* ast.TypeSpec {}
3131 for _ , file := range p .Files {
@@ -99,7 +99,7 @@ func isExportedInterfaceAlias(typeSpec *ast.TypeSpec, fileImports []*ast.ImportS
9999
100100 name := selector .Sel .Name
101101 srcPkgPath := findSourcePackage (ident , fileImports )
102- srcPackageAst , err := getPackageAst (srcPkgPath )
102+ srcPackageAst , err := getPackage (srcPkgPath )
103103 if err != nil {
104104 return false
105105 }
@@ -120,19 +120,14 @@ func isExportedInterfaceAlias(typeSpec *ast.TypeSpec, fileImports []*ast.ImportS
120120 return false
121121}
122122
123- func getPackageAst (packagePath string ) (* ast .Package , error ) {
123+ func getPackage (packagePath string ) (* pkg .Package , error ) {
124124 srcPkg , err := pkg .Load (packagePath )
125125 if err != nil {
126126 return nil , err
127127 }
128128
129129 fs := token .NewFileSet ()
130- srcAst , err := pkg .AST (fs , srcPkg )
131- if err != nil {
132- return nil , err
133- }
134-
135- return srcAst , nil
130+ return pkg .AST (fs , srcPkg )
136131}
137132
138133func findTypeByName (types []* ast.TypeSpec , name string ) (* ast.TypeSpec , bool ) {
0 commit comments