mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 00:55:55 +00:00
cleanup type detection for consistency
This commit is contained in:
parent
16db983bf1
commit
7b66fcf26c
1 changed files with 6 additions and 8 deletions
|
|
@ -339,16 +339,14 @@ func HandleAction(a Action, value interface{}, colID uint64) (*Bit, error) {
|
|||
return nil, fmt.Errorf("Value %s does not exist in definition map", v)
|
||||
}
|
||||
case InputSingleRowBool:
|
||||
switch value.(type) {
|
||||
case bool:
|
||||
if value.(bool) {
|
||||
bit.RowID = *a.RowID
|
||||
} else { // value is not True.
|
||||
return nil, err
|
||||
}
|
||||
default:
|
||||
v, ok := value.(bool)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("single-row-boolean value %v must equate to a Bool", value)
|
||||
}
|
||||
if v == false { // False returns a nil error and nil bit.
|
||||
return nil, err
|
||||
}
|
||||
bit.RowID = *a.RowID
|
||||
case InputValueToRow:
|
||||
v, ok := value.(float64)
|
||||
if !ok {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue