Created
September 17, 2014 16:36
-
-
Save anandkunal/77d15adcc22cc38804ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (r *RPC) Delete(key string, ack *bool) error { | |
r.mu.Lock() | |
defer r.mu.Unlock() | |
var found bool | |
_, found = r.cache[key] | |
if !found { | |
return NotFoundError | |
} | |
delete(r.cache, key) | |
*ack = true | |
r.requests.Delete++ | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment