RedisCmd 增加 MarshalBinary 实现, redis库序列化数据时, 演示实现此方法

This commit is contained in:
2025-04-20 18:05:01 +08:00
parent 3aba815bac
commit 55e6ac5d83
2 changed files with 9 additions and 0 deletions

View File

@ -30,4 +30,9 @@ func TestRedisCmd_String(t *testing.T) {
So(err, ShouldBeNil)
So(string(jsonData), ShouldEqual, `["SET"]`)
})
Convey("redis cmd MarshalBinary", t, func() {
str, err := RedisCommandSet.MarshalBinary()
So(err, ShouldBeNil)
So(string(str), ShouldEqual, `"SET"`)
})
}