Skip to content

Commit

Permalink
fix: Fix bool ToBool bug (redis#2626)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamyab98 authored Jun 13, 2023
1 parent 0bdc7dd commit b1800df
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b1800df

Please sign in to comment.