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

Method SetDefault

cache.go:86–88  ·  view source on GitHub ↗

Add an item to the cache, replacing any existing item, using the default expiration.

(k string, x interface{})

Source from the content-addressed store, hash-verified

84// Add an item to the cache, replacing any existing item, using the default
85// expiration.
86func (c *cache) SetDefault(k string, x interface{}) {
87 c.Set(k, x, DefaultExpiration)
88}
89
90// Add an item to the cache only if an item doesn't already exist for the given
91// key, or if the existing item has expired. Returns an error otherwise.

Callers

nothing calls this directly

Calls 1

SetMethod · 0.95

Tested by

no test coverage detected