You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When associating examples with types, functions and methods (go/doc/example.go:classifyExamples), the identifier name associated with method M of type G[T] is G[T]_M. Since square brackets are not allowed in Go identifiers, it isn't possible to write an example function that matches that string.
When constructing a string for a method that will match an example
function's name, remove brackets from the receiver. This makes it
possible to write an example associated with a method of a generic
type.
Also, modify the test for classifying examples to check that all the
expected examples actually appear.
Fixesgolang/go#52496.
Change-Id: Iebc5768f6cb91df9671dd701b97958fb8081f986
Reviewed-on: https://go-review.googlesource.com/c/go/+/401761
TryBot-Result: Gopher Robot <[email protected]>
Run-TryBot: Jonathan Amsterdam <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When associating examples with types, functions and methods (go/doc/example.go:classifyExamples), the identifier name associated with method
M
of typeG[T]
isG[T]_M
. Since square brackets are not allowed in Go identifiers, it isn't possible to write an example function that matches that string.I suggest removing the square brackets, as was done in https://golang.org/cl/354689 to fix #48032.
The text was updated successfully, but these errors were encountered: