handle null sql iso8601, kitchen time and simple date column values

This commit is contained in:
Gerasimos (Makis) Maropoulos 2021-11-29 12:54:27 +02:00
parent 226a4cb064
commit ad2ec68c34
No known key found for this signature in database
GPG Key ID: ACAB76DFB0DD3F3B
3 changed files with 6 additions and 0 deletions

View File

@ -104,6 +104,8 @@ func (t *ISO8601) Scan(src interface{}) error {
return err
}
*t = tt
case nil:
*t = ISO8601(time.Time{})
default:
return fmt.Errorf("ISO8601: unknown type of: %T", v)
}

View File

@ -100,6 +100,8 @@ func (t *KitckenTime) Scan(src interface{}) error {
return err
}
*t = tt
case nil:
*t = KitckenTime(time.Time{})
default:
return fmt.Errorf("KitckenTime: unknown type of: %T", v)
}

View File

@ -105,6 +105,8 @@ func (t *SimpleDate) Scan(src interface{}) error {
return err
}
*t = tt
case nil:
*t = SimpleDate(time.Time{})
default:
return fmt.Errorf("SimpleDate: unknown type of: %T", v)
}