From 22449da5d316846d40726d84087cab2676f8578a Mon Sep 17 00:00:00 2001 From: yaling888 <73897884+yaling888@users.noreply.github.com> Date: Wed, 25 May 2022 02:00:24 +0800 Subject: [PATCH] Fix: cache cleanup panic --- common/cache/cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/cache/cache.go b/common/cache/cache.go index b87392b4..6735a387 100644 --- a/common/cache/cache.go +++ b/common/cache/cache.go @@ -61,7 +61,7 @@ func (c *cache[K, V]) GetWithExpire(key K) (payload V, expired time.Time) { func (c *cache[K, V]) cleanup() { c.mapping.Range(func(k, v any) bool { - key := k.(string) + key := k elm := v.(*element[V]) if time.Since(elm.Expired) > 0 { c.mapping.Delete(key)