Remove unused error, add return for string and []byte types with dst set
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
1496fcad0e
commit
4131c431ef
|
@ -9,8 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrMemoryCacheNotExists = errors.New("item does not exist")
|
ErrMemoryCacheNotExists = errors.New("item does not exist")
|
||||||
ErrMemoryCacheNotSupported = errors.New("memory cache does not support retrieving items without a destination pointer")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type MemoryCache struct {
|
type MemoryCache struct {
|
||||||
|
@ -53,12 +52,12 @@ func (mc *MemoryCache) Get(key string, dst ...interface{}) ([]byte, error) {
|
||||||
case *string:
|
case *string:
|
||||||
if v != nil {
|
if v != nil {
|
||||||
*v = item.(string)
|
*v = item.(string)
|
||||||
return nil, nil
|
return []byte(item.(string)), nil
|
||||||
}
|
}
|
||||||
case *[]byte:
|
case *[]byte:
|
||||||
if v != nil {
|
if v != nil {
|
||||||
*v = item.([]byte)
|
*v = item.([]byte)
|
||||||
return nil, nil
|
return item.([]byte), nil
|
||||||
}
|
}
|
||||||
case *int:
|
case *int:
|
||||||
if v != nil {
|
if v != nil {
|
||||||
|
|
Loading…
Reference in New Issue