Closed
Description
Hey,
How can I mock columns that are stored as datetimes? It seems that RowsFromCSVString
sets driver.Value
s that are always []byte
, and Scan
is unable to parse time.time
objects from them:
Scan error on column index 4: unsupported driver -> Scan pair: []uint8 -> *time.Time
I'd guess this would work if either RowsFromCSVString
was able to directly create time.time
objects when it encounters them or there was another way to assemble sqlmock.rows
objects.
Example:
sqlmock.ExpectQuery("SELECT now()").
WillReturnRows(sqlmock.RowsFromCSVString([]string{"now"}, "2014-02-12 16:04:15.879588-08"))
# sql: Scan error on column index 0: unsupported driver -> Scan pair: []uint8 -> *time.Time
Metadata
Metadata
Assignees
Labels
No labels