Skip to content

Commit

Permalink
fix default selector ignoring Receiver and returning first matching f…
Browse files Browse the repository at this point in the history
…unction name (#509)

Co-authored-by: na4ma4 <na4ma4@users.noreply.github.com>
  • Loading branch information
na4ma4 and na4ma4 authored Nov 24, 2024
1 parent 2385abb commit 0800736
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parse/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ func getFunction(exp ast.Expr, pi *PkgInfo) (*Function, error) {
for _, imp := range pi.Imports {
if firstname == imp.Name {
for _, f := range imp.Info.Funcs {
if funcname == f.Name {
if funcname == f.Name && f.Receiver == "" {
return f, nil
}
}
Expand Down

0 comments on commit 0800736

Please sign in to comment.