eko / gocache

☔️ A complete Go cache library that brings you multiple ways of managing your caches
https://vincent.composieux.fr/article/i-wrote-gocache-a-complete-and-extensible-go-cache-library/
MIT License
2.42k stars 192 forks source link

cache type error with using generics #193

Closed mpasokolov closed 1 year ago

mpasokolov commented 1 year ago

Hello everyone! Can you help me, i don't understand.

4.1.2 version.

my import:

    "github.com/eko/gocache/lib/v4/cache"
    "github.com/eko/gocache/lib/v4/store"
    redis_store "github.com/eko/gocache/store/redis/v4"

I have this code:

Снимок экрана 2023-01-18 в 07 48 27

How to fix it?

jrynd commented 1 year ago

You have to replace T with the type of the thing that you're trying to store in the cache, i.e. string

eko commented 1 year ago

Exactly, T have to be replaced with your type.

Thank you for your answer.

Closing this issue for now but feel free to reopen if you still have any issue with the library.