Use GoBytes

This commit is contained in:
Frederick Akalin 2018-09-22 11:29:00 -07:00
parent 6de94b0b99
commit 2364b288cc
1 changed files with 2 additions and 7 deletions

View File

@ -1990,13 +1990,8 @@ func (rc *SQLiteRows) Next(dest []driver.Value) error {
dest[i] = nil
continue
}
n := int(C.sqlite3_column_bytes(rc.s.s, C.int(i)))
switch dest[i].(type) {
default:
slice := make([]byte, n)
copy(slice[:], (*[1 << 30]byte)(p)[0:n])
dest[i] = slice
}
n := C.sqlite3_column_bytes(rc.s.s, C.int(i))
dest[i] = C.GoBytes(p, n)
case C.SQLITE_NULL:
dest[i] = nil
case C.SQLITE_TEXT: