🩹 update tests

This commit is contained in:
Fenny
2020-11-06 16:05:53 +01:00
parent 52b1e73a5b
commit cdf009407b
22 changed files with 522 additions and 51 deletions

View File

@@ -57,10 +57,11 @@ func (s *Storage) Get(key string) ([]byte, error) {
return val, err
}
// Set key with value
// Set key with value
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
// Ain't Nobody Got Time For That
if len(val) <= 0 {
if len(key) <= 0 || len(val) <= 0 {
return nil
}
return s.db.Set(context.Background(), key, val, exp).Err()
@@ -68,6 +69,10 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
// Delete key by key
func (s *Storage) Delete(key string) error {
// Ain't Nobody Got Time For That
if len(key) <= 0 {
return nil
}
return s.db.Del(context.Background(), key).Err()
}