From 00ee0da5289dd5aaf9263ee39c8082ff3a9557c7 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Sat, 21 Jun 2014 14:44:22 -0600 Subject: Add Open() options, flock timeout. This commit changes Open() to provide an additional Options argument. The options argument currently only has a Timeout which will cause the Open() to return ErrTimeout if a file lock cannot be obtained in time. Fixes #207. --- tx_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tx_test.go') diff --git a/tx_test.go b/tx_test.go index 2fe4723..0528c0d 100644 --- a/tx_test.go +++ b/tx_test.go @@ -301,7 +301,7 @@ func TestTx_CopyFile(t *testing.T) { assert.NoError(t, db.View(func(tx *Tx) error { return tx.CopyFile(dest, 0600) })) - db2, err := Open(dest, 0600) + db2, err := Open(dest, 0600, nil) assert.NoError(t, err) defer db2.Close() @@ -366,7 +366,7 @@ func TestTx_CopyFile_Error_Normal(t *testing.T) { func ExampleTx_Rollback() { // Open the database. - db, _ := Open(tempfile(), 0666) + db, _ := Open(tempfile(), 0666, nil) defer os.Remove(db.Path()) defer db.Close() @@ -400,7 +400,7 @@ func ExampleTx_Rollback() { func ExampleTx_CopyFile() { // Open the database. - db, _ := Open(tempfile(), 0666) + db, _ := Open(tempfile(), 0666, nil) defer os.Remove(db.Path()) defer db.Close() @@ -417,7 +417,7 @@ func ExampleTx_CopyFile() { defer os.Remove(toFile) // Open the cloned database. - db2, _ := Open(toFile, 0666) + db2, _ := Open(toFile, 0666, nil) defer db2.Close() // Ensure that the key exists in the copy. -- cgit v1.2.3