This commit is contained in:
Jay
2020-04-20 10:24:33 +08:00
parent 97b90146ca
commit 45c6f4ad2f
2 changed files with 16 additions and 3 deletions
+12
View File
@@ -32,6 +32,18 @@ func New(dbPath ...string) error {
return err
}
tx, err := db.Begin(true)
if err != nil {
return err
}
if _, err := tx.CreateBucketIfNotExists([]byte("led")); err != nil {
tx.Rollback()
return err
}
tx.Commit()
return nil
}