1
0
mirror of https://github.com/zhashkevych/go-sqlxmock.git synced 2024-11-24 08:12:13 +02:00

tests/NullInt.Scan: remove support for int{,8,16,32}

Those types are not driver.Value, but int was necessary because sqlmock
was not properly using pure driver.Value before. Now that I fixed the
issue in previous commit, we can remove the old hack.
This commit is contained in:
Olivier Mengué 2018-07-12 16:03:36 +02:00
parent 896b89a023
commit 92e5f46c1c

View File

@ -23,20 +23,6 @@ func (ni *NullInt) Scan(value interface{}) error {
switch v := value.(type) {
case nil:
ni.Integer, ni.Valid = 0, false
// FIXME int, int8, int16, int32 types are handled here but that should not
// be necessary: only int64 is a driver.Value
// Unfortunately, the sqlmock testsuite currently relies on that because
// sqlmock doesn't properly limits itself internally to pure driver.Value.
case int:
ni.Integer, ni.Valid = v, true
case int8:
ni.Integer, ni.Valid = int(v), true
case int16:
ni.Integer, ni.Valid = int(v), true
case int32:
ni.Integer, ni.Valid = int(v), true
case int64:
const maxUint = ^uint(0)
const minUint = 0