Closed
Description
I'm using the database/sql driver implementation on a *DB obtained using sql.Open.
My code looks a bit like this.
var dataRows []map[string]interface{}
for rowNum := 0; rows.Next(); rowNum++ {
newMap := make(map[string]interface{})
err = rows.MapScan(newMap)
// ...
}
json.Marshal(dataRows)
// [{"id":"MQ==","name":"b28="},{"id":"Mg==","name":"cmVhbCBuYW1l"}]
// expected:
// [{"id":1,"name":"oo"},{"id":2,"name":"real name"}]
All values unmarshaled into dataRows are of []byte
type, including numbers, strings, etc. This is causing problems.
Would you be open to a pull request implementing the type switch from binaryRows
on textRows
?
Metadata
Metadata
Assignees
Labels
No labels