-
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
proposal: pointer: new package for pointer allocation and dereference #64749
Comments
we just declined #61082 |
@seankhliao I see. I searched for prior art, but must not have looked at closed proposals. |
These functions seem easy enough to define in the relatively few places where they are heavily needed. Also, ToValueWithNil is strict in both arguments, whereas the more useful semantics (in my experience) are lazy: |
@adonovan Fair points. As far as value, ok := *somePointer
if !ok {
value = someValueIfNil
} (which I would also love to have instead tbh) |
No change in consensus, so declined. |
Proposal Details
A project I'm working on currently makes heavy use of utilities that:
ex 1.
ex 2.
ex.
It would be nice to have utilities like these in the standard library as they seem generally useful.
ex.
The text was updated successfully, but these errors were encountered: