Skip to content

Instantly share code, notes, and snippets.

@anandkunal
Created September 17, 2014 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anandkunal/77d15adcc22cc38804ac to your computer and use it in GitHub Desktop.
Save anandkunal/77d15adcc22cc38804ac to your computer and use it in GitHub Desktop.
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