mirror of
https://github.com/redis/go-redis.git
synced 2025-07-10 16:40:57 +03:00
fix: Fix bool ToBool bug (#2626)
This commit is contained in:
@ -340,6 +340,8 @@ func (cmd *Cmd) Bool() (bool, error) {
|
|||||||
|
|
||||||
func toBool(val interface{}) (bool, error) {
|
func toBool(val interface{}) (bool, error) {
|
||||||
switch val := val.(type) {
|
switch val := val.(type) {
|
||||||
|
case bool:
|
||||||
|
return val, nil
|
||||||
case int64:
|
case int64:
|
||||||
return val != 0, nil
|
return val != 0, nil
|
||||||
case string:
|
case string:
|
||||||
|
Reference in New Issue
Block a user