Skip to content

Commit 8adbb56

Browse files
committed
return *Item from layered cache fetch instead of interface{}
1 parent 2f6b517 commit 8adbb56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

layeredcache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func (c *LayeredCache) Replace(primary, secondary string, value interface{}) boo
9595
// Attempts to get the value from the cache and calles fetch on a miss.
9696
// If fetch returns an error, no value is cached and the error is returned back
9797
// to the caller.
98-
func (c *LayeredCache) Fetch(primary, secondary string, duration time.Duration, fetch func() (interface{}, error)) (interface{}, error) {
98+
func (c *LayeredCache) Fetch(primary, secondary string, duration time.Duration, fetch func() (interface{}, error)) (*Item, error) {
9999
item := c.Get(primary, secondary)
100100
if item != nil {
101101
return item, nil

0 commit comments

Comments
 (0)