From 42bfac5e4fe34d590a9d25ac2fe2d77cc6ddce39 Mon Sep 17 00:00:00 2001 From: Davyd Dzhahaiev Date: Tue, 8 Aug 2017 15:49:13 +0200 Subject: [PATCH] to not convert every value to []byte allows to put different types of data. For example time.Time and represent it correctly in output struct when using mocked replies --- stmt.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stmt.go b/stmt.go index 8d0bb10..cea5d31 100644 --- a/stmt.go +++ b/stmt.go @@ -146,7 +146,7 @@ func (smt *FakeStmt) QueryContext(ctx context.Context, args []driver.NamedValue) for _, record := range fResp.Response { oneRow := &row{cols: make([]interface{}, len(columnNames))} for _, col := range columnNames { - oneRow.cols[colIndexes[col]] = []byte(record[col].(string)) + oneRow.cols[colIndexes[col]] = record[col] } rows = append(rows, oneRow) }