From 0d1aed0741a3e2a3dd11eb6514218f991a2e90f9 Mon Sep 17 00:00:00 2001 From: yijiong <59520517+yzy613@users.noreply.github.com> Date: Tue, 19 Nov 2024 23:30:29 +0800 Subject: [PATCH] fix(os/gcache): function `Remove` returns value not `*gvar.Var` as previous version (#3936) --- os/gcache/gcache_adapter_memory.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/os/gcache/gcache_adapter_memory.go b/os/gcache/gcache_adapter_memory.go index 4653c2df0..aceb0dc39 100644 --- a/os/gcache/gcache_adapter_memory.go +++ b/os/gcache/gcache_adapter_memory.go @@ -288,11 +288,7 @@ func (c *AdapterMemory) GetExpire(ctx context.Context, key interface{}) (time.Du // If multiple keys are given, it returns the value of the last deleted item. func (c *AdapterMemory) Remove(ctx context.Context, keys ...interface{}) (*gvar.Var, error) { defer c.lru.Remove(keys...) - value, err := c.doRemove(ctx, keys...) - if err != nil { - return nil, err - } - return gvar.New(value), nil + return c.doRemove(ctx, keys...) } func (c *AdapterMemory) doRemove(_ context.Context, keys ...interface{}) (*gvar.Var, error) {