From d4561d08f932c67703663088a3bd3bf456d47bf6 Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Wed, 1 Oct 2025 10:48:54 +0100 Subject: [PATCH] Refactor. --- driver/driver.go | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/driver/driver.go b/driver/driver.go index 6cfb8cd..5d28473 100644 --- a/driver/driver.go +++ b/driver/driver.go @@ -801,18 +801,7 @@ func (r *rows) Next(dest []driver.Value) error { } for i := range dest { scan := r.scanType(i) - switch v := dest[i].(type) { - case int64: - if scan == _BOOL { - switch v { - case 1: - dest[i] = true - case 0: - dest[i] = false - } - continue - } - case []byte: + if v, ok := dest[i].([]byte); ok { if len(v) == cap(v) { // a BLOB continue } @@ -827,16 +816,19 @@ func (r *rows) Next(dest []driver.Value) error { } } dest[i] = string(v) - case float64: - break - default: - continue } - if scan == _TIME { + switch scan { + case _TIME: t, err := r.tmRead.Decode(dest[i]) if err == nil { dest[i] = t - continue + } + case _BOOL: + switch dest[i] { + case int64(0): + dest[i] = false + case int64(1): + dest[i] = true } } }