-
Notifications
You must be signed in to change notification settings - Fork 18k
sync: Map.Delete to return deleted value #25396
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
Comments
It is not possible to do that without breaking Go1 compatibility. I assume that you don't want to make an extra |
/cc @bcmills |
@agnivade, thanks for the reply. However, I don't think an extra I have little knowledge about Go1 compatibility, but in my understanding, add return value to |
@localvar 'fraid not, the current interpretation of the Go 1 contract assumes that someone has assigned a method as a function; eg
Changing the signature of |
Ah I was pretty sure this was raised before but could not find anything when I searched. Thanks. |
Is adding a new function (for an ugly example: I checked the source code and find the internal |
I need to know if an item is actually deleted when call
Delete
ofsync.Map
, but the function returns nothing currently.Is it possible for it to return the deleted value and/or a
bool
to indicate whether something is really deleted?Thanks.
The text was updated successfully, but these errors were encountered: