!85 fix(proto): fix proto key err

Merge pull request !85 from bandl/auto-5261189-master-1635925021767
This commit is contained in:
bandl 2021-11-03 07:37:57 +00:00 committed by Gitee
commit 47cdf0859b
2 changed files with 2 additions and 5 deletions

View File

@ -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",

View File

@ -15,7 +15,7 @@ const (
// NewBaseKey
// keyttlexpire
func NewBaseKey(key string, t ...int64) *BaseKey {
var expire *timestamppb.Timestamp
var expire *timestamppb.Timestamp = nil
var ttl int64
if len(t) > 1 {