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

spec: clarification of "value receiver" vs "pointer receiver" (missing definition) #18828

Closed
go101 opened this issue Jan 28, 2017 · 2 comments
Closed
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@go101
Copy link

go101 commented Jan 28, 2017

4 "value receiver" plus one "value-receiver".

Besides no definition for it, I feel it is better to be replaced with "non-pointer receiver", as pointers are also values.

@griesemer
Copy link
Contributor

@golang101 I agree that "non-pointer receiver" is technically more correct; though it feels a bit more "clunky" than "value receiver" (even though I agree that a pointer is technically also a value). I'm going to let this simmer for a bit. I'm not quite convinced that "non-pointer" is the right choice, or if there's a better term (or we just need to define "value receiver").

@griesemer griesemer changed the title spec: there are five "value receiver" occurrences in spec but no definition for it. spec: clarification of "value receiver" vs "pointer receiver" (missing definition) Jan 30, 2017
@griesemer griesemer added this to the Go1.9Maybe milestone Jan 30, 2017
@bradfitz bradfitz modified the milestones: Go1.10, Go1.9Maybe Jul 20, 2017
@bradfitz bradfitz added Documentation NeedsFix The path to resolution is known, but the work has not been done. labels Jul 20, 2017
@rsc rsc modified the milestones: Go1.10, Go1.11 Dec 14, 2017
@ianlancetaylor ianlancetaylor modified the milestones: Go1.11, Unplanned Jun 28, 2018
@go101
Copy link
Author

go101 commented May 12, 2021

I decided to close this issue. Because when a method is declared with a non-pointer receiver, and implicit method with the corresponding pointer receiver is also declared. So a value receiver could be viewed as both pointer and non-pointer receiver.

@go101 go101 closed this as completed May 12, 2021
@golang golang locked and limited conversation to collaborators May 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

6 participants