multi: switch from bolt packge to bbolt package for all imports

This commit is contained in:
Olaoluwa Osuntokun committed 2018-11-29 20:33:49 -08:00
1 parent 0edf1ae081
commit 1fd3aac925
41 files changed
+404 -405

No files matched your search

+12 -12
View File
@@ -108,11 +108,11 @@ func TestOrderOfMigrations(t *testing.T) {
versions := []version{
{0, nil},
{1, nil},
{2, func(tx *bolt.Tx) error {
{2, func(tx *bbolt.Tx) error {
appliedMigration = 2
return nil
}},
{3, func(tx *bolt.Tx) error {
{3, func(tx *bbolt.Tx) error {
appliedMigration = 3
return nil
}},
@@ -184,7 +184,7 @@ func TestMigrationWithPanic(t *testing.T) {
beforeMigrationFunc := func(d *DB) {
// Insert data in database and in order then make sure that the
// key isn't changes in case of panic or fail.
d.Update(func(tx *bolt.Tx) error {
d.Update(func(tx *bbolt.Tx) error {
bucket, err := tx.CreateBucketIfNotExists(bucketPrefix)
if err != nil {
return err
@@ -197,7 +197,7 @@ func TestMigrationWithPanic(t *testing.T) {
// Create migration function which changes the initially created data and
// throw the panic, in this case we pretending that something goes.
migrationWithPanic := func(tx *bolt.Tx) error {
migrationWithPanic := func(tx *bbolt.Tx) error {
bucket, err := tx.CreateBucketIfNotExists(bucketPrefix)
if err != nil {
return err
@@ -218,7 +218,7 @@ func TestMigrationWithPanic(t *testing.T) {
t.Fatal("migration panicked but version is changed")
}
err = d.Update(func(tx *bolt.Tx) error {
err = d.Update(func(tx *bbolt.Tx) error {
bucket, err := tx.CreateBucketIfNotExists(bucketPrefix)
if err != nil {
return err
@@ -255,7 +255,7 @@ func TestMigrationWithFatal(t *testing.T) {
afterMigration := []byte("aftermigration")
beforeMigrationFunc := func(d *DB) {
d.Update(func(tx *bolt.Tx) error {
d.Update(func(tx *bbolt.Tx) error {
bucket, err := tx.CreateBucketIfNotExists(bucketPrefix)
if err != nil {
return err
@@ -269,7 +269,7 @@ func TestMigrationWithFatal(t *testing.T) {
// Create migration function which changes the initially created data and
// return the error, in this case we pretending that something goes
// wrong.
migrationWithFatal := func(tx *bolt.Tx) error {
migrationWithFatal := func(tx *bbolt.Tx) error {
bucket, err := tx.CreateBucketIfNotExists(bucketPrefix)
if err != nil {
return err
@@ -290,7 +290,7 @@ func TestMigrationWithFatal(t *testing.T) {
t.Fatal("migration failed but version is changed")
}
err = d.Update(func(tx *bolt.Tx) error {
err = d.Update(func(tx *bbolt.Tx) error {
bucket, err := tx.CreateBucketIfNotExists(bucketPrefix)
if err != nil {
return err
@@ -328,7 +328,7 @@ func TestMigrationWithoutErrors(t *testing.T) {
// Populate database with initial data.
beforeMigrationFunc := func(d *DB) {
d.Update(func(tx *bolt.Tx) error {
d.Update(func(tx *bbolt.Tx) error {
bucket, err := tx.CreateBucketIfNotExists(bucketPrefix)
if err != nil {
return err
@@ -340,7 +340,7 @@ func TestMigrationWithoutErrors(t *testing.T) {
}
// Create migration function which changes the initially created data.
migrationWithoutErrors := func(tx *bolt.Tx) error {
migrationWithoutErrors := func(tx *bbolt.Tx) error {
bucket, err := tx.CreateBucketIfNotExists(bucketPrefix)
if err != nil {
return err
@@ -362,7 +362,7 @@ func TestMigrationWithoutErrors(t *testing.T) {
"successfully applied migration")
}
err = d.Update(func(tx *bolt.Tx) error {
err = d.Update(func(tx *bbolt.Tx) error {
bucket, err := tx.CreateBucketIfNotExists(bucketPrefix)
if err != nil {
return err
@@ -406,7 +406,7 @@ func TestMigrationReversion(t *testing.T) {
// Update the database metadata to point to one more than the highest
// known version.
err = cdb.Update(func(tx *bolt.Tx) error {
err = cdb.Update(func(tx *bbolt.Tx) error {
newMeta := &Meta{
DbVersionNumber: getLatestDBVersion(dbVersions) + 1,
}