File tree Expand file tree Collapse file tree
src/compress/golang/plugin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ func (p *goParser) parseFile(filePath string) ([]Function, error) {
4141
4242 thirdPartyImports := make (map [string ]struct {})
4343 projectImports := make (map [string ]string )
44+ sysImports := make (map [string ]string )
4445 for _ , imp := range f .Imports {
4546 importPath := imp .Path .Value [1 : len (imp .Path .Value )- 1 ] // remove the quotes
4647 importBaseName := filepath .Base (importPath )
@@ -53,6 +54,10 @@ func (p *goParser) parseFile(filePath string) ([]Function, error) {
5354
5455 isSysPkg := ! strings .Contains (strings .Split (importPath , "/" )[0 ], "." )
5556
57+ if isSysPkg {
58+ sysImports [importAlias ] = importPath
59+ }
60+
5661 // Ignoring golang standard libraries(like net/http)
5762 if ! isSysPkg {
5863 // Distinguish between project packages and third party packages
@@ -113,6 +118,11 @@ func (p *goParser) parseFile(filePath string) ([]Function, error) {
113118 return true
114119 }
115120
121+ // skip sys imports
122+ if _ , ok = sysImports [x .(* ast.Ident ).Name ]; ok {
123+ return true
124+ }
125+
116126 methodCalls = append (methodCalls , funcName )
117127 return true
118128 case * ast.Ident :
You can’t perform that action at this time.
0 commit comments