diff options
author | Frederick Akalin <akalin@gmail.com> | 2018-09-22 11:29:00 -0700 |
---|---|---|
committer | Frederick Akalin <akalin@gmail.com> | 2018-09-22 11:29:00 -0700 |
commit | 2364b288cca5e899f1a852d08745a55a9bcf5294 (patch) | |
tree | b7699d22efc89c93cb5edc1181f4e41444320d73 | |
parent | Merge pull request #637 from mattn/fix-build2 (diff) | |
download | golite-2364b288cca5e899f1a852d08745a55a9bcf5294.tar.gz golite-2364b288cca5e899f1a852d08745a55a9bcf5294.tar.xz |
Use GoBytes
-rw-r--r-- | sqlite3.go | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -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: |