From 89b950690297fc1d0f226a11f3f73dc8f006367f Mon Sep 17 00:00:00 2001 From: bryanqiu Date: Fri, 28 Apr 2023 09:00:12 +0800 Subject: [PATCH] v1.3.2 fix cfg bug --- cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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