Ensure strings are converted to records if possible
This commit is contained in:
parent
4849eb4486
commit
d476bec5a2
1 changed files with 4 additions and 0 deletions
|
@ -202,6 +202,10 @@ func ConvertToRecord(obj interface{}, tb string) (val *sql.Thing, err error) {
|
||||||
default:
|
default:
|
||||||
err = fmt.Errorf("Expected a record of type '%s', but found '%v'", tb, obj)
|
err = fmt.Errorf("Expected a record of type '%s', but found '%v'", tb, obj)
|
||||||
}
|
}
|
||||||
|
case string:
|
||||||
|
if val = sql.ParseThing(now); val == nil {
|
||||||
|
err = fmt.Errorf("Expected a record of type '%s', but found '%v'", tb, obj)
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
switch tb {
|
switch tb {
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue