Set Sets the given value under the specified key.
(key string, value interface{})
| 100 | |
| 101 | // Set Sets the given value under the specified key. |
| 102 | func (slm ShardLockMaps) Set(key string, value interface{}) { |
| 103 | shard := slm.GetShard(key) |
| 104 | shard.Lock() |
| 105 | shard.items[key] = value |
| 106 | shard.Unlock() |
| 107 | } |
| 108 | |
| 109 | // SetNX Sets the given value under the specified key if no value was associated with it. |
| 110 | func (slm ShardLockMaps) SetNX(key string, value interface{}) bool { |