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

ristretto readme example has incomplete information about importing ristretto_store #234

Open
akaushik759 opened this issue Jan 19, 2024 · 4 comments

Comments

@akaushik759
Copy link
Contributor

ristretto readme example has incomplete information about importing ristretto_store, if u don't import "github.com/eko/gocache/store/ristretto/v4" as ristretto_store then it would error out

Steps for Reproduction

  1. Copy paste the ristretto cache basic example present in readme

  2. Install
    -> go get github.com/eko/gocache/lib/v4
    -> go get github.com/eko/gocache/store/ristretto/v4
    -> go get github.com/dgraph-io/ristretto

  3. You would see "Unresolved reference 'ristretto_store'" in your editor

Expected behavior:
Successful imports

Actual behavior:
Screenshot 2024-01-19 at 8 44 08 PM

Solution:
I found the solution - import the gocache ristretto as ristretto_store to avoid conflict

import (
	"github.com/dgraph-io/ristretto"
	"github.com/eko/gocache/lib/v4/cache"
	"github.com/eko/gocache/lib/v4/store"
	ristretto_store "github.com/eko/gocache/store/ristretto/v4"
)

I also have a branch ready with the README update, but can't push the branch and raise PR, let me know if a fix for this is required, I would push and raise a PR @eko

Platforms:
Apple M2 Sonoma

Versions:
github.com/eko/gocache/lib/v4 v4.1.3
github.com/eko/gocache/store/ristretto/v4 v4.2.0

Which versions are you running?
go version go1.21.5 darwin/arm64

@eko
Copy link
Owner

eko commented Jan 19, 2024

Hi @akaushik759,

Could you please submit a PR for fixing the README file?

Thank you

@akaushik759
Copy link
Contributor Author

I have the fix in a branch but facing permission denied on pushing it.
I guess I don't have write access? @eko

@eko
Copy link
Owner

eko commented Jan 23, 2024

@akaushik759,

Could you please fork the repository, push the branch on your own repository and open a pull request against this repository please?

Thank you

@akaushik759
Copy link
Contributor Author

My bad.

Here's the PR - #235

Thanks

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

2 participants