good morning!!!!

Skip to content
Snippets Groups Projects
Commit 8a243f9f authored by Carlos Nieto's avatar Carlos Nieto
Browse files

Fixing datatype guessing when using map[string]interface{}.

parent f429b21c
No related branches found
No related tags found
No related merge requests found
......@@ -109,7 +109,11 @@ func (self *T) fetchResult(itemt reflect.Type, rows *sql.Rows, columns []string)
// Destination is a map.
case reflect.Map:
if cv.Type() != itemt.Elem() {
cv, _ = util.StringToType(svalue, itemt.Elem())
if itemt.Elem().Kind() == reflect.Interface {
cv, _ = util.StringToType(svalue, cv.Type())
} else {
cv, _ = util.StringToType(svalue, itemt.Elem())
}
}
if cv.IsValid() {
item.SetMapIndex(reflect.ValueOf(column), cv)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment