fix ErrNotExist

This commit is contained in:
Fenny
2020-11-05 06:10:39 +01:00
parent 86b9cfe4c1
commit 3721c99616
2 changed files with 4 additions and 4 deletions

View File

@@ -109,8 +109,8 @@ func (s *Storage) Get(key string) ([]byte, error) {
}
// If the expiration time has already passed, then return nil
if exp <= time.Now().Unix() && exp != 0 {
return nil, nil
if exp != 0 && exp <= time.Now().Unix() {
return nil, ErrNotExist
}
return data, nil