From 4131c431ef0561eb64ecc138b4bffe112c61be6f Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 5 Oct 2019 16:42:59 -0400 Subject: [PATCH] Remove unused error, add return for string and []byte types with dst set --- memory.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/memory.go b/memory.go index 0c842a9..0883be4 100644 --- a/memory.go +++ b/memory.go @@ -9,8 +9,7 @@ import ( ) var ( - ErrMemoryCacheNotExists = errors.New("item does not exist") - ErrMemoryCacheNotSupported = errors.New("memory cache does not support retrieving items without a destination pointer") + ErrMemoryCacheNotExists = errors.New("item does not exist") ) type MemoryCache struct { @@ -53,12 +52,12 @@ func (mc *MemoryCache) Get(key string, dst ...interface{}) ([]byte, error) { case *string: if v != nil { *v = item.(string) - return nil, nil + return []byte(item.(string)), nil } case *[]byte: if v != nil { *v = item.([]byte) - return nil, nil + return item.([]byte), nil } case *int: if v != nil {