You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use MapScan for accessing all the columns in a sql.
Columns with datatype numeric are fetched as []uint8 and must be converted to another datatype
for Json-serialization. Would it be possible to have a default datatype string for this
datatype for marshalling json ?
for rows.Next() {
t := make(map[string]interface{})
if err = rows.MapScan(t); err == nil {
results = append(results, t)
} else {
return
}
if val, ok := (*results)[i]["ads_strnr"].([]uint8); ok {
ga, err := strconv.Atoi(string(val))
checkErr(err)
(*results)[i]["ads_strnr"] = ga
}
The text was updated successfully, but these errors were encountered:
I use MapScan for accessing all the columns in a sql.
Columns with datatype numeric are fetched as []uint8 and must be converted to another datatype
for Json-serialization. Would it be possible to have a default datatype string for this
datatype for marshalling json ?
The text was updated successfully, but these errors were encountered: