Skip to content

Commit 97b8466

Browse files
welkeyeverAsterDY
authored andcommitted
fix: skip parse the node is nor ident or selectorExpr (cloudwego#3)
1 parent e61b175 commit 97b8466

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/compress/golang/plugin/go_ast.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ func (p *goParser) parseFile(filePath string) ([]Function, error) {
9191
x := expr.X
9292
for {
9393
if _, ok := x.(*ast.Ident); !ok {
94-
seleExp, _ := x.(*ast.SelectorExpr)
94+
seleExp, ok := x.(*ast.SelectorExpr)
95+
if !ok {
96+
return false
97+
}
9598
x = seleExp.X
9699
continue
97100
}

0 commit comments

Comments
 (0)