Skip to content
This repository has been archived by the owner on Jan 3, 2022. It is now read-only.

Commit

Permalink
Patch up test
Browse files Browse the repository at this point in the history
  • Loading branch information
mweagle committed Apr 28, 2018
1 parent 691f292 commit f4aec5b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions func_select.go
Expand Up @@ -67,6 +67,11 @@ func (f *SelectFunc) UnmarshalJSON(data []byte) error {
if err := json.Unmarshal(v.FnSelect[0], &positionSelector); err != nil {
return err
}
// If it's an integer or boolean, there's an issue
switch positionSelector.(type) {
case bool, int:
return &json.UnsupportedValueError{Str: fmt.Sprintf("%v", positionSelector)}
}
f.Selector = fmt.Sprintf("%v", positionSelector)

// What about the second one?
Expand Down

0 comments on commit f4aec5b

Please sign in to comment.