Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go/doc: cannot associate examples with generic methods #52496

Closed
jba opened this issue Apr 22, 2022 · 2 comments
Closed

go/doc: cannot associate examples with generic methods #52496

jba opened this issue Apr 22, 2022 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.

Comments

@jba
Copy link
Contributor

jba commented Apr 22, 2022

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.

I suggest removing the square brackets, as was done in https://golang.org/cl/354689 to fix #48032.

@jba jba added the NeedsFix The path to resolution is known, but the work has not been done. label Apr 22, 2022
@jba jba self-assigned this Apr 22, 2022
@gopherbot
Copy link

Change https://go.dev/cl/401761 mentions this issue: go/doc: remove brackets from receiver in example identifier

@jba
Copy link
Contributor Author

jba commented Apr 22, 2022

Clarification: removing the square brackets and everything in between them. So G[T]_M becomes G_M.

@rsc rsc unassigned jba Jun 22, 2022
@golang golang locked and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

2 participants