doc: "Named result parameters" section in effective_go.html is less clear than Go specification #42050
Labels
Milestone
Comments
The spec explains it clearer: https://golang.org/ref/spec#Return_statements |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Run following code
What did you expect to see?
Main: explicit Goroutine: named
What did you see instead?
Main: explicit Goroutine: explicit
While I expect this is intended albeit slightly unintuitive behavior, the documentation says named results are initialized and tied to an unadorned return which presupposes that an explicit return is not tied. I humbly propose to alter the documentation to better reflect the actual behavior.
The text was updated successfully, but these errors were encountered: