cleanup type detection for consistency

This commit is contained in:
Michael Baird 2017-06-27 10:39:11 -05:00 committed by Linh Vo
parent 453e5417f8
commit 3ac40a4a5f

View file

@ -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 {