gonna be one of those days...
This commit is contained in:
parent
f9c7f14b7b
commit
41f1a3cfcb
1 changed files with 1 additions and 1 deletions
2
cache.go
2
cache.go
|
@ -84,7 +84,7 @@ func (c *Cache) Replace(key string, value interface{}) bool {
|
|||
// Attempts to get the value from the cache and calles fetch on a miss.
|
||||
// If fetch returns an error, no value is cached and the error is returned back
|
||||
// to the caller.
|
||||
func (c *Cache) Fetch(key string, duration time.Duration, fetch func() (interface{}, error)) (interface{}, error) {
|
||||
func (c *Cache) Fetch(key string, duration time.Duration, fetch func() (interface{}, error)) (*Item, error) {
|
||||
item := c.Get(key)
|
||||
if item != nil {
|
||||
return item, nil
|
||||
|
|
Loading…
Reference in a new issue