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. --- cmd/bolt/get_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmd/bolt/get_test.go') diff --git a/cmd/bolt/get_test.go b/cmd/bolt/get_test.go index d491971..7b7c3a0 100644 --- a/cmd/bolt/get_test.go +++ b/cmd/bolt/get_test.go @@ -45,7 +45,8 @@ func TestGetKeyNotFound(t *testing.T) { SetTestMode(true) open(func(db *bolt.DB, path string) { db.Update(func(tx *bolt.Tx) error { - return tx.CreateBucket([]byte("widgets")) + _, err := tx.CreateBucket([]byte("widgets")) + return err }) db.Close() output := run("get", path, "widgets", "foo") -- cgit v1.2.3