-
Notifications
You must be signed in to change notification settings - Fork 366
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
[BUG]: cannot use generic type ristretto.Cache[K z.Key, V any] without instantiation #394
Comments
Same issue using badger and upgrading: - github.com/dgraph-io/ristretto v0.1.1 // indirect
+ github.com/dgraph-io/ristretto v1.0.0 // indirect |
i have same issue on go v1.23.1 |
|
The repository at github.com/ory/viper was archived 4 years ago. The current version of github.com/spf13/viper does not use ristretto. Ristretto v1 uses generics and may not be compatible with packages that require ristretto without generics. You can try using ristretto v0 (the latest version is v0.2.0). |
@Hamper I don't use viper, but I use badger |
Badger supports ristretto with generics starting from v4.3.0. Versions v4.2.0 and below do not support generics in the call to newCache and require ristretto v0 |
The related issue in the badger repo: dgraph-io/badger#2005 This is tricky to resolve if you have an app with direct or transitive dependencies such that you include both badger/v3 and badger/v4. It feels like the only way to resolve this is if ristretto were to have gone from v0.x to v2 so that the module import path for each version of ristretto would be different (two different I'm in a situation where our dependencies are forcing the ristretto version up, thus breaking our badger/v3 import. |
What version of Ristretto are you using?
github.com/ory/viper
/root/go/pkg/mod/github.com/ory/viper@v1.7.5/viper.go:224:16: cannot use generic type ristretto.Cache[K z.Key, V any] without instantiation
getting below error post ristretto go package is updated to v1.0.0 from github.com/dgraph-io/ristretto v0.1.1
/root/go/pkg/mod/github.com/ory/viper@v1.7.5/viper.go:253:17: implicit function instantiation requires go1.18 or later (-lang was set to go1.12; check go.mod)
/root/go/pkg/mod/github.com/ory/viper@v1.7.5/viper.go:253:37: cannot use generic type ristretto.Config[K z.Key, V any] without instantiation
/root/go/pkg/mod/github.com/ory/viper@v1.7.5/viper.go:307:15: cannot use generic type ristretto.Cache[K z.Key, V any] without instantiation
/root/go/pkg/mod/github.com/ory/viper@v1.7.5/viper.go:307:36: cannot use generic type ristretto.Config[K z.Key, V any] without instantiation
What version of Go are you using?
1.22.6
Have you tried reproducing the issue with the latest release?
None
What is the hardware spec (RAM, CPU, OS)?
docker arm64
What steps will reproduce the bug?
any package who is using this package will get the issue
github.com/ory/go-acc
Expected behavior and actual result.
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: