aboutsummaryrefslogtreecommitdiff
path: root/functional_test.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-03-21 09:46:03 -0600
committerBen Johnson <benbjohnson@yahoo.com>2014-03-21 09:52:01 -0600
commit3cc959fb1a51296c3bb391c80280e37a02f0b6a5 (patch)
treef5b3993dd328b6896b57f954e4fc37125054ce97 /functional_test.go
parentMerge pull request #65 from benbjohnson/fix-tx-buckets-sort-order (diff)
downloaddedo-3cc959fb1a51296c3bb391c80280e37a02f0b6a5.tar.gz
dedo-3cc959fb1a51296c3bb391c80280e37a02f0b6a5.tar.xz
Remove ease-of-use functions from the DB type.
Functions such as DB.Put(), DB.Get(), and DB.Delete() were originally added to be easy to use, however, after implementing Bolt in multiple projects I have found these ease-of-use functions useless. Nearly every use case requires multiple calls in a single transaction. Using the DB ease of use functions turned out to be an antipattern.
Diffstat (limited to 'functional_test.go')
-rw-r--r--functional_test.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/functional_test.go b/functional_test.go
index 41bffd6..866ec95 100644
--- a/functional_test.go
+++ b/functional_test.go
@@ -28,7 +28,9 @@ func TestParallelTxs(t *testing.T) {
var current testdata
withOpenDB(func(db *DB, path string) {
- db.CreateBucket("widgets")
+ db.Do(func(tx *Tx) error {
+ return tx.CreateBucket("widgets")
+ })
// Maintain a set of concurrent readers.
var wg sync.WaitGroup