Skip to content

Commit 0800736

Browse files
authored
fix default selector ignoring Receiver and returning first matching function name (#509)
Co-authored-by: na4ma4 <[email protected]>
1 parent 2385abb commit 0800736

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

parse/parse.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ func getFunction(exp ast.Expr, pi *PkgInfo) (*Function, error) {
671671
for _, imp := range pi.Imports {
672672
if firstname == imp.Name {
673673
for _, f := range imp.Info.Funcs {
674-
if funcname == f.Name {
674+
if funcname == f.Name && f.Receiver == "" {
675675
return f, nil
676676
}
677677
}

0 commit comments

Comments
 (0)