修复自定义Marshal序列化的BUG

This commit is contained in:
2025-01-22 15:55:39 +08:00
parent c00354fe46
commit 10759d9c5e
8 changed files with 48 additions and 29 deletions

View File

@ -9,11 +9,11 @@ package consts
type RedisCmd string
func (rc RedisCmd) String() string {
return string(rc)
func (rc *RedisCmd) String() string {
return string(*rc)
}
func (rc RedisCmd) MarshalJSON() ([]byte, error) {
func (rc *RedisCmd) MarshalJSON() ([]byte, error) {
return []byte(rc.String()), nil
}