mirror of
https://github.com/gofiber/storage.git
synced 2025-10-05 16:48:25 +08:00
fix ErrNotExist
This commit is contained in:
@@ -109,8 +109,8 @@ func (s *Storage) Get(key string) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If the expiration time has already passed, then return nil
|
// If the expiration time has already passed, then return nil
|
||||||
if exp <= time.Now().Unix() && exp != 0 {
|
if exp != 0 && exp <= time.Now().Unix() {
|
||||||
return nil, nil
|
return nil, ErrNotExist
|
||||||
}
|
}
|
||||||
|
|
||||||
return data, nil
|
return data, nil
|
||||||
|
@@ -129,8 +129,8 @@ func (s *Storage) Get(key string) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If the expiration time has already passed, then return nil
|
// If the expiration time has already passed, then return nil
|
||||||
if exp <= time.Now().Unix() && exp != 0 {
|
if exp != 0 && exp <= time.Now().Unix() {
|
||||||
return nil, nil
|
return nil, ErrNotExist
|
||||||
}
|
}
|
||||||
|
|
||||||
return data, nil
|
return data, nil
|
||||||
|
Reference in New Issue
Block a user