You've already forked go-sqlxmock
mirror of
https://github.com/zhashkevych/go-sqlxmock.git
synced 2025-06-24 21:56:48 +02:00
tests/Null{Int,Time}: do not change the value in case of error
Do not touch the existing value in case of error. No capital on error message.
This commit is contained in:
@ -54,8 +54,7 @@ func (ni *NullInt) Scan(value interface{}) error {
|
|||||||
}
|
}
|
||||||
ni.Integer, ni.Valid = n, true
|
ni.Integer, ni.Valid = n, true
|
||||||
default:
|
default:
|
||||||
ni.Valid = false
|
return fmt.Errorf("can't convert %T to integer", value)
|
||||||
return fmt.Errorf("Can't convert %T to integer", value)
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -76,8 +75,7 @@ func (nt *NullTime) Scan(value interface{}) error {
|
|||||||
case time.Time:
|
case time.Time:
|
||||||
nt.Time, nt.Valid = v, true
|
nt.Time, nt.Valid = v, true
|
||||||
default:
|
default:
|
||||||
nt.Valid = false
|
return fmt.Errorf("can't convert %T to time.Time", value)
|
||||||
return fmt.Errorf("Can't convert %T to time.Time", value)
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user