diff --git a/cache.go b/cache.go index bd4621d..38a5710 100644 --- a/cache.go +++ b/cache.go @@ -63,7 +63,6 @@ type Config struct { func NewCache[T any](getter Getter[T], cfg Config) Cacher[T] { var c = new(cacher[T]) // Getter - c.cfg = cfg c.getter = getter // Local cache @@ -100,6 +99,7 @@ func NewCache[T any](getter Getter[T], cfg Config) Cacher[T] { cfg.UseExpiredCache = &[]bool{true}[0] } + c.cfg = cfg name := reflect.TypeOf(*new(T)).String() log.PrintPretty("new cache '"+name+"' by config:", cfg) return c