From 0800736cf7b88a1eb03e2a2b05fe0281a9eb9225 Mon Sep 17 00:00:00 2001 From: na4ma4 <25967676+na4ma4@users.noreply.github.com> Date: Mon, 25 Nov 2024 00:53:19 +1000 Subject: [PATCH] fix default selector ignoring Receiver and returning first matching function name (#509) Co-authored-by: na4ma4 --- parse/parse.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse/parse.go b/parse/parse.go index 3421669..e68703b 100644 --- a/parse/parse.go +++ b/parse/parse.go @@ -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 } }