mirror of
https://github.com/redis/go-redis.git
synced 2025-04-17 20:17:02 +03:00
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…
x
Reference in New Issue
Block a user