From 2364b288cca5e899f1a852d08745a55a9bcf5294 Mon Sep 17 00:00:00 2001 From: Frederick Akalin Date: Sat, 22 Sep 2018 11:29:00 -0700 Subject: [PATCH] Use GoBytes --- sqlite3.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sqlite3.go b/sqlite3.go index b17e634..b681cff 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -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: