walletdb: update examples to acccount for new 2nd param for bdb Open/Create
This commit is contained in:
parent
b19df70ddd
commit
eb2582bbde
2 changed files with 4 additions and 4 deletions
walletdb
|
@ -55,7 +55,7 @@ func TestAddDuplicateDriver(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
dbPath := "dupdrivertest.db"
|
dbPath := "dupdrivertest.db"
|
||||||
db, err := walletdb.Create(dbType, dbPath)
|
db, err := walletdb.Create(dbType, dbPath, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("failed to create database: %v", err)
|
t.Errorf("failed to create database: %v", err)
|
||||||
return
|
return
|
||||||
|
|
|
@ -28,7 +28,7 @@ func ExampleCreate() {
|
||||||
// this, but it's done here in the example to ensure the example cleans
|
// this, but it's done here in the example to ensure the example cleans
|
||||||
// up after itself.
|
// up after itself.
|
||||||
dbPath := filepath.Join(os.TempDir(), "examplecreate.db")
|
dbPath := filepath.Join(os.TempDir(), "examplecreate.db")
|
||||||
db, err := walletdb.Create("bdb", dbPath)
|
db, err := walletdb.Create("bdb", dbPath, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
return
|
return
|
||||||
|
@ -47,7 +47,7 @@ var exampleNum = 0
|
||||||
func exampleLoadDB() (walletdb.DB, func(), error) {
|
func exampleLoadDB() (walletdb.DB, func(), error) {
|
||||||
dbName := fmt.Sprintf("exampleload%d.db", exampleNum)
|
dbName := fmt.Sprintf("exampleload%d.db", exampleNum)
|
||||||
dbPath := filepath.Join(os.TempDir(), dbName)
|
dbPath := filepath.Join(os.TempDir(), dbName)
|
||||||
db, err := walletdb.Create("bdb", dbPath)
|
db, err := walletdb.Create("bdb", dbPath, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ func Example_basicUsage() {
|
||||||
// this, but it's done here in the example to ensure the example cleans
|
// this, but it's done here in the example to ensure the example cleans
|
||||||
// up after itself.
|
// up after itself.
|
||||||
dbPath := filepath.Join(os.TempDir(), "exampleusage.db")
|
dbPath := filepath.Join(os.TempDir(), "exampleusage.db")
|
||||||
db, err := walletdb.Create("bdb", dbPath)
|
db, err := walletdb.Create("bdb", dbPath, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue