From ab20fd9fd1ee6369bfb09b83506da3838e361184 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Thu, 13 Feb 2025 10:41:10 -0300 Subject: src/dedo.go: Include CreateBucketIfNotExists() in BucketI --- src/dedo.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dedo.go b/src/dedo.go index 66daba2..0541bab 100644 --- a/src/dedo.go +++ b/src/dedo.go @@ -76,6 +76,7 @@ type BucketI interface{ Delete([]byte) error ForEach(func([]byte, []byte) error) error CreateBucket([]byte) (BucketI, error) + CreateBucketIfNotExists([]byte) (BucketI, error) DeleteBucket([]byte) error Bucket([]byte) (BucketI, error) NextID() []byte @@ -742,7 +743,7 @@ func bucketCreateBucketIfNotExists(b *bucketT, key []byte) (*bucketT, error) { return child, nil } -func (b *bucketT) CreateBucketIfNotExists(key []byte) (*bucketT, error) { +func (b *bucketT) CreateBucketIfNotExists(key []byte) (BucketI, error) { return bucketCreateBucketIfNotExists(b, key) } @@ -3616,7 +3617,7 @@ func (tx *transactionT) CreateBucket(name []byte) (BucketI, error) { /// is too long. The bucket instance is only valid for the lifetime of the /// transaction. func txCreateBucketIfNotExists(tx *transactionT, name []byte) (*bucketT, error) { - return tx.root.CreateBucketIfNotExists(name) + return bucketCreateBucketIfNotExists(&tx.root, name) } func (tx *transactionT) CreateBucketIfNotExists(name []byte) (BucketI, error) { -- cgit v1.2.3