From 2505b9a7dcca1e5d9d80ebfc6be7afcd97ba02dd Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Tue, 15 Apr 2014 23:45:06 -0400 Subject: Return bucket from CreateBucket() functions. This commit changes the API for: Tx.CreateBucket() Tx.CreateBucketIfNotExists() Bucket.CreateBucket() Bucket.CreateBucketIfNotExists() These functions now return the *Bucket and error instead of just the error. --- tx.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tx.go') diff --git a/tx.go b/tx.go index 9f86d5e..5844ffe 100644 --- a/tx.go +++ b/tx.go @@ -88,13 +88,13 @@ func (tx *Tx) Bucket(name []byte) *Bucket { // CreateBucket creates a new bucket. // Returns an error if the bucket already exists, if the bucket name is blank, or if the bucket name is too long. -func (tx *Tx) CreateBucket(name []byte) error { +func (tx *Tx) CreateBucket(name []byte) (*Bucket, error) { return tx.root.CreateBucket(name) } // CreateBucketIfNotExists creates a new bucket if it doesn't already exist. // Returns an error if the bucket name is blank, or if the bucket name is too long. -func (tx *Tx) CreateBucketIfNotExists(name []byte) error { +func (tx *Tx) CreateBucketIfNotExists(name []byte) (*Bucket, error) { return tx.root.CreateBucketIfNotExists(name) } -- cgit v1.2.3