Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need update readme #134

Open
jyno12 opened this issue Sep 8, 2023 · 2 comments
Open

need update readme #134

jyno12 opened this issue Sep 8, 2023 · 2 comments

Comments

@jyno12
Copy link

jyno12 commented Sep 8, 2023

import (
  "log"
  "github.com/dgraph-io/badger/v3"
  c "github.com/ostafen/clover"
  badgerstore "github.com/ostafen/store/badger"
)

these example code in readme file cause some error. github.com/ostafen/storedosen't exist now. We can use the code in the db_test file as follows

	"github.com/dgraph-io/badger/v3"
	c "github.com/ostafen/clover/v2"
	badgerstore "github.com/ostafen/clover/v2/store/badger"
@ostafen
Copy link
Owner

ostafen commented Sep 8, 2023

Can you send a PR?

@EdwinWalela
Copy link
Contributor

Running the sample code on the README

import (
	"github.com/dgraph-io/badger/v4"
	c "github.com/ostafen/clover"
	badgerstore "github.com/ostafen/store/badger"
)

func main() {
       // use OpenWithStore() if you want to select a different storage backend
	store, _ := badgerstore.Open(badger.DefaultOptions("").WithInMemory(true)) // opens a badger in memory database
	db, _ := c.OpenWithStore(store)

	defer db.Close() // remember to close the db when you have done
}

Output

main.go:5:2: no required module provides package github.com/ostafen/clover; to add it:
        go get github.com/ostafen/clover
main.go:6:2: no required module provides package github.com/ostafen/store/badger; to add it:

However, changing the import statement to

import (
	"github.com/dgraph-io/badger/v4"
	c "github.com/ostafen/clover/v2"
	badgerstore "github.com/ostafen/clover/v2/store/badger"
)

The packages are imported correctly. I can send in a PR if need be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants