From f8ad21bad37735eb7e47330383f204d7a49c0ff9 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Mon, 24 Mar 2014 11:43:06 -0600 Subject: Make DB/Tx API more consistent. I consolidated the DB.Tx() and DB.RWTx() calls into a single DB.Begin(writable bool) call. This is more consistent with the database/sql library. I also changed the DB.Do() and DB.With() call to DB.Update() and DB.View(), respectively. This is more intuitive and more inline with other database verbiage. --- functional_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'functional_test.go') diff --git a/functional_test.go b/functional_test.go index 866ec95..6ca75b8 100644 --- a/functional_test.go +++ b/functional_test.go @@ -28,7 +28,7 @@ func TestParallelTxs(t *testing.T) { var current testdata withOpenDB(func(db *DB, path string) { - db.Do(func(tx *Tx) error { + db.Update(func(tx *Tx) error { return tx.CreateBucket("widgets") }) @@ -51,7 +51,7 @@ func TestParallelTxs(t *testing.T) { go func() { mutex.RLock() local := current - tx, err := db.Tx() + tx, err := db.Begin(false) mutex.RUnlock() if err == ErrDatabaseNotOpen { wg.Done() @@ -89,7 +89,7 @@ func TestParallelTxs(t *testing.T) { pending = pending[currentBatchSize:] // Start write transaction. - tx, err := db.RWTx() + tx, err := db.Begin(true) if !assert.NoError(t, err) { t.FailNow() } -- cgit v1.2.3