We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 73addb2 + 11092c1 commit 2d72735Copy full SHA for 2d72735
README.md
@@ -48,11 +48,11 @@ import (
48
49
func main() {
50
// Create a simple cache. key as string, value as int.
51
- simpleCache := simple.NewCache[string, int](simple.WithExpiration(time.Hour))
+ simpleCache := simple.NewCache[string, int]()
52
53
// Create a cache for Number constraint. key as string, value as int.
54
nc := cache.NewNumber[string, int](simpleCache)
55
- nc.Set("age", 26)
+ nc.Set("age", 26, cache.WithExpiration(time.Hour))
56
57
// This will be compile error, because string is not satisfied cache.Number constraint.
58
// nc := cache.NewNumber[string, string](simpleCache)
0 commit comments