mirror of https://github.com/go-redis/redis.git
fix: Fix bool ToBool bug (#2626)
This commit is contained in:
parent
0bdc7dd898
commit
b1800df239
|
@ -340,6 +340,8 @@ func (cmd *Cmd) Bool() (bool, error) {
|
|||
|
||||
func toBool(val interface{}) (bool, error) {
|
||||
switch val := val.(type) {
|
||||
case bool:
|
||||
return val, nil
|
||||
case int64:
|
||||
return val != 0, nil
|
||||
case string:
|
||||
|
|
Loading…
Reference in New Issue