From c1d09f7c4122508a8dd2ee2edbebcea3ca398cae Mon Sep 17 00:00:00 2001 From: ben-toogood Date: Tue, 15 Sep 2020 17:09:40 +0100 Subject: [PATCH] store: implement s3 blob store (#2005) --- blob.go | 6 +----- blob_test.go | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/blob.go b/blob.go index 4022cb6..9f2ee51 100644 --- a/blob.go +++ b/blob.go @@ -126,11 +126,7 @@ func (b *blobStore) Delete(key string, opts ...store.BlobOption) error { // check for the namespaces bucket bucket := tx.Bucket([]byte(options.Namespace)) if bucket == nil { - return store.ErrNotFound - } - - if bucket.Get([]byte(key)) == nil { - return store.ErrNotFound + return nil } return bucket.Delete([]byte(key)) diff --git a/blob_test.go b/blob_test.go index 34fcab0..815b981 100644 --- a/blob_test.go +++ b/blob_test.go @@ -60,12 +60,12 @@ func TestBlobStore(t *testing.T) { t.Run("DeleteIncorrectNamespace", func(t *testing.T) { err := blob.Delete("hello", store.BlobNamespace("bar")) - assert.Equal(t, store.ErrNotFound, err, "Error should be not found") + assert.Nil(t, err, "Error should be nil") }) t.Run("DeleteCorrectNamespaceIncorrectKey", func(t *testing.T) { err := blob.Delete("world", store.BlobNamespace("micro")) - assert.Equal(t, store.ErrNotFound, err, "Error should be not found") + assert.Nil(t, err, "Error should be nil") }) t.Run("DeleteCorrectNamespace", func(t *testing.T) {