From 428a8fa8f8de30084be59aa4a5b4cc5b93206fab Mon Sep 17 00:00:00 2001 From: HuangJiaLuo <1820799930@qq.com> Date: Wed, 6 Oct 2021 20:39:52 +0800 Subject: [PATCH] feat(worker): change string to proto.KeyBase --- pkg/lru/woker_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/lru/woker_test.go b/pkg/lru/woker_test.go index ef1a757..77a6ad8 100644 --- a/pkg/lru/woker_test.go +++ b/pkg/lru/woker_test.go @@ -3,6 +3,7 @@ package lru import ( "context" "gitee.com/timedb/wheatCache/pkg/event" + "gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/timedb/wheatCache/pkg/structure/stringx" "github.com/stretchr/testify/require" "testing" @@ -16,9 +17,11 @@ func TestWorker(t *testing.T) { workEvent := event.NewEvent(OptionEventName) workEvent.SetValue(WorkFuncEventKey, event.EventWorkFunc(func() (interface{}, error) { v1 := stringx.NewStringSingle() - key := "v1" + key := proto.BaseKey{ + Key: "v1", + } res, _ := v1.Set("123") - lru.Add(key, v1) + lru.Add(&key, v1) return res, nil })) workEvent.InitWaitEvent()