Skip to content

Commit c2eec4e

Browse files
authored
Fix example of specifying value received method in -funcs
My experimentation shows that `dir/pkg.Type.Method` doesn't work, but `(dir/pkg.Type).Method` does. Looking at https://golang.org/pkg/go/types/#Func.FullName implementation: https://github.com/golang/go/blob/18bcc7c2854f900dfb631d7ef01a839021e24576/src/go/types/object.go#L465-L486 it seems to me that in both cases of pointer and value received the brackets are written.
1 parent ff88973 commit c2eec4e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/analysis/passes/printf/printf.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ known formatting functions or methods. If the name contains a period,
5858
it must denote a specific function using one of the following forms:
5959
6060
dir/pkg.Function
61-
dir/pkg.Type.Method
61+
(dir/pkg.Type).Method
6262
(*dir/pkg.Type).Method
6363
6464
Otherwise the name is interpreted as a case-insensitive unqualified

0 commit comments

Comments
 (0)