-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
reflect: deprecate PtrTo #59599
Comments
See #48665 |
According to this 1.21 will already be 1.N+3 |
CC @mvdan : OK with deprecating these now? |
Per the rules we agreed on and wrote on https://github.com/golang/go/wiki/Deprecated, yes, I'm perfectly fine with deprecating at this point :) |
This proposal has been added to the active column of the proposals project |
go.dev/wiki/Deprecated says:
It is unclear to me that PtrTo really is "problematic in some way". It's just an old spelling, and the doc comment for PtrTo calls that out. It seems like we should not mark it Deprecated based on this. |
Based on the discussion above, this proposal seems like a likely decline. |
I don‘t have strong feelings either way. However, one of Go‘s strength is to have exactly one way of doing things. This seems to imply that adding another way should include deprecating the old way. |
Presumably if we were to mark it as deprecated, that could allow IDEs to downrank it in suggested code completions. Do we have some other way to feed in that signal for old names with preferred alternatives? |
I'm not against rejecting this proposal; the reasons make sense. But in the past, a different approach must have been used to decide whether a feature should be deprecated or not. Look at the functions in the |
@gazerro, thanks for pointing that out. We have indeed not been following that part of the policy, so I've removed that sentence, and then this becomes a likely accept. |
Based on the discussion above, this proposal seems like a likely accept. |
No change in consensus, so accepted. 🎉 |
Replace reflect.PtrTo with reflect.PointerTo Fixes golang#59599 Change-Id: I49407193e2050543ef983cd637703acc682d9f51
Change https://go.dev/cl/511035 mentions this issue: |
Replace reflect.PtrTo with reflect.PointerTo Fixes golang#59599 Change-Id: I49407193e2050543ef983cd637703acc682d9f51
Replace reflect.PtrTo with reflect.PointerTo Fixes golang#59599 Change-Id: I49407193e2050543ef983cd637703acc682d9f51
Replace reflect.PtrTo with reflect.PointerTo Fixes golang#59599 Change-Id: I49407193e2050543ef983cd637703acc682d9f51
Replace reflect.PtrTo with reflect.PointerTo Fixes golang#59599 Change-Id: I49407193e2050543ef983cd637703acc682d9f51
Replace reflect.PtrTo with reflect.PointerTo Fixes golang#59599 Change-Id: I49407193e2050543ef983cd637703acc682d9f51
Change https://go.dev/cl/548036 mentions this issue: |
Updates #59599. For #61422. Change-Id: I923be38b719a78dd983372acad93f710a53b0922 Reviewed-on: https://go-review.googlesource.com/c/go/+/548036 Reviewed-by: Keith Randall <khr@google.com> TryBot-Bypass: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org>
Updates golang#59599. For golang#61422. Change-Id: I923be38b719a78dd983372acad93f710a53b0922 Reviewed-on: https://go-review.googlesource.com/c/go/+/548036 Reviewed-by: Keith Randall <khr@google.com> TryBot-Bypass: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org>
The
reflect.PointerTo
function was added in version 1.18 to replace thereflect.PtrTo
function.reflect.PtrTo
was supposed to be deprecated in version 1.19, as recommended in https://github.com/golang/go/wiki/Deprecated, but it was not done.The text was updated successfully, but these errors were encountered: