aboutsummaryrefslogtreecommitdiff
path: root/tx.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-04-15 23:45:06 -0400
committerBen Johnson <benbjohnson@yahoo.com>2014-04-15 23:45:06 -0400
commit2505b9a7dcca1e5d9d80ebfc6be7afcd97ba02dd (patch)
tree4d351709b0ec5d5eb1803b59c84e868c07889208 /tx.go
parentFix race detector CI. (diff)
downloaddedo-2505b9a7dcca1e5d9d80ebfc6be7afcd97ba02dd.tar.gz
dedo-2505b9a7dcca1e5d9d80ebfc6be7afcd97ba02dd.tar.xz
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.
Diffstat (limited to 'tx.go')
-rw-r--r--tx.go4
1 files changed, 2 insertions, 2 deletions
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)
}