cache
cache copied to clipboard
How to use cache like map[string]any?
Is there any way that I can use this cache like map[string]any, I mean using get operation as following?
val, err := mycache.Get(ctx, key)
The difference is, I do not know the type of value when I query the key, so I do not know the type of wanted which I need to create.
if err := mycache.Get(ctx, key, &wanted); err == nil {
fmt.Println(wanted)
}