Skip to content
This repository has been archived by the owner on Mar 9, 2019. It is now read-only.

Open API #52

Closed
cespare opened this issue Feb 26, 2014 · 4 comments
Closed

Open API #52

cespare opened this issue Feb 26, 2014 · 4 comments

Comments

@cespare
Copy link

cespare commented Feb 26, 2014

Hey, I was curious about the initialization API:

var db bolt.DB
if err := db.Open("/path", 0666); err != nil {
  ...

I didn't see how this worked until I looked at an example. I was looking for a global function to open a database. The typical pattern I would expect to find (examples: net, database/sql, leveldb-go, mgo) is like this:

db, err := bolt.Open("/path", 0666); err != nil {
  ...

Was this a deliberate break from convention? Not a big deal, just curious. (I'd also be happy to send over a trivial PR to add this.)

@benbjohnson
Copy link
Member

That's a good point. @tv42 mentioned that in #41 as well. It's an easy change. I'll go ahead and add it in.

@cespare
Copy link
Author

cespare commented Feb 26, 2014

Oops, sorry for not looking through the issue list.

@cespare cespare closed this as completed Feb 26, 2014
@benbjohnson
Copy link
Member

@cespare I accidentally closed it before because I fixed another issue in #41. I just re-opened it.

@cespare
Copy link
Author

cespare commented Feb 26, 2014

but...I closed it. It was a dup.

/me is confused

heyitsanthony pushed a commit to heyitsanthony/bolt that referenced this issue Nov 16, 2017
tx: load freelist on Check() [continuation of PR#49]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants