From 0b9230094ab93edca0305b6b57345cc3e521f376 Mon Sep 17 00:00:00 2001 From: bandl <1658002533@qq.com> Date: Wed, 3 Nov 2021 15:36:55 +0800 Subject: [PATCH] fix(proto): fix proto key err --- client/client_test.go | 5 +---- pkg/proto/define.go | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/client/client_test.go b/client/client_test.go index 897b69d..ab89403 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -14,10 +14,7 @@ func TestClient(t *testing.T) { require.NoError(t, err) ctx := context.Background() - bKey := &proto.BaseKey{ - Key: "apple", - Ttl: 10, - } + bKey := proto.NewBaseKey("apple") resp, err := cli.Set(ctx, &proto.SetRequest{ Key: bKey, Val: "yyyy", diff --git a/pkg/proto/define.go b/pkg/proto/define.go index 271091f..5b5f408 100644 --- a/pkg/proto/define.go +++ b/pkg/proto/define.go @@ -15,7 +15,7 @@ const ( // NewBaseKey // key,ttl,expire func NewBaseKey(key string, t ...int64) *BaseKey { - var expire *timestamppb.Timestamp + var expire *timestamppb.Timestamp = nil var ttl int64 if len(t) > 1 {