This commit is contained in:
Lanre Ade 2024-02-06 16:16:37 -08:00 committed by GitHub
commit 5eed14bedb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1503,6 +1503,11 @@ func (d Decimal) MarshalBinary() (data []byte, err error) {
// Scan implements the sql.Scanner interface for database deserialization. // Scan implements the sql.Scanner interface for database deserialization.
func (d *Decimal) Scan(value interface{}) error { func (d *Decimal) Scan(value interface{}) error {
if value == nil {
d = nil
return nil
}
// first try to see if the data is stored in database as a Numeric datatype // first try to see if the data is stored in database as a Numeric datatype
switch v := value.(type) { switch v := value.(type) {