Skip to content

Commit

Permalink
Clean up tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Jan 5, 2025
1 parent 43cf17c commit fe0b581
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/typing/converters/string_converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ func (BooleanConverter) Convert(value any) (string, error) {
return fmt.Sprint(castedValue), nil
default:
// First try to cast the value into a string and see if we can parse it
stringValue := strings.ToLower(fmt.Sprint(value))
if stringValue == "0" || stringValue == "false" {
switch strings.ToLower(fmt.Sprint(value)) {
case "0", "false":
return "false", nil
} else if stringValue == "1" || stringValue == "true" {
case "1", "true":
return "true", nil
} else {
default:
return "", fmt.Errorf("failed to cast colVal as boolean, colVal: '%v', type: %T", value, value)
}
}
Expand Down

0 comments on commit fe0b581

Please sign in to comment.