diff options
Diffstat (limited to 'src/dedo.go')
-rw-r--r-- | src/dedo.go | 5 |
1 files changed, 3 insertions, 2 deletions
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) { |