-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
Is there anyway to atomicly set a value if one does not already exist?
I have tried a couple different things and they don't seem to work for my use case, I have examples if wanted:
CompareAndSwap(key, nil, value)which doesn't seem to work on unset keys.GetOrSetandGetOrComputebut those don`t seem to be threadsafe.
If there is currently no way to do this would you be open to a PR adding it?
Thanks
Metadata
Metadata
Assignees
Labels
No labels