修复相关BUG + 增加单元测试, 覆盖率100%
This commit is contained in:
10
redis.go
10
redis.go
@ -9,15 +9,15 @@ 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) {
|
||||
return []byte(rc.String()), nil
|
||||
func (rc RedisCmd) MarshalJSON() ([]byte, error) {
|
||||
return []byte(`"` + rc.String() + `"`), nil
|
||||
}
|
||||
|
||||
var (
|
||||
const (
|
||||
RedisCommandExists RedisCmd = "EXISTS"
|
||||
RedisCommandTTL RedisCmd = "TTL"
|
||||
RedisCommandSet RedisCmd = "SET"
|
||||
|
Reference in New Issue
Block a user