forked from p53841790/wheat-cache
fix(proto): fix proto key err
This commit is contained in:
parent
eccfd6a439
commit
0b9230094a
|
@ -14,10 +14,7 @@ func TestClient(t *testing.T) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
bKey := &proto.BaseKey{
|
bKey := proto.NewBaseKey("apple")
|
||||||
Key: "apple",
|
|
||||||
Ttl: 10,
|
|
||||||
}
|
|
||||||
resp, err := cli.Set(ctx, &proto.SetRequest{
|
resp, err := cli.Set(ctx, &proto.SetRequest{
|
||||||
Key: bKey,
|
Key: bKey,
|
||||||
Val: "yyyy",
|
Val: "yyyy",
|
||||||
|
|
|
@ -15,7 +15,7 @@ const (
|
||||||
// NewBaseKey
|
// NewBaseKey
|
||||||
// key,ttl,expire
|
// key,ttl,expire
|
||||||
func NewBaseKey(key string, t ...int64) *BaseKey {
|
func NewBaseKey(key string, t ...int64) *BaseKey {
|
||||||
var expire *timestamppb.Timestamp
|
var expire *timestamppb.Timestamp = nil
|
||||||
var ttl int64
|
var ttl int64
|
||||||
|
|
||||||
if len(t) > 1 {
|
if len(t) > 1 {
|
||||||
|
|
Loading…
Reference in New Issue