diff --git a/stubs_test.go b/stubs_test.go index 410d76c..fcd8b29 100644 --- a/stubs_test.go +++ b/stubs_test.go @@ -23,6 +23,11 @@ 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: @@ -31,6 +36,7 @@ func (ni *NullInt) Scan(value interface{}) error { 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