MCPcopy Create free account
hub / github.com/patrickmn/go-cache / delete

Method delete

cache.go:914–923  ·  view source on GitHub ↗
(k string)

Source from the content-addressed store, hash-verified

912}
913
914func (c *cache) delete(k string) (interface{}, bool) {
915 if c.onEvicted != nil {
916 if v, found := c.items[k]; found {
917 delete(c.items, k)
918 return v.Object, true
919 }
920 }
921 delete(c.items, k)
922 return nil, false
923}
924
925type keyAndValue struct {
926 key string

Callers 3

DeleteMethod · 0.95
DeleteExpiredMethod · 0.95

Calls

no outgoing calls

Tested by 1