2
0

Add standard nil test to gofrs-uuid.UUID.Set

This commit is contained in:
Jack Christensen
2020-02-19 10:50:58 -06:00
parent f3816bd1c0
commit 666bd514e2
+5
View File
@@ -17,6 +17,11 @@ type UUID struct {
} }
func (dst *UUID) Set(src interface{}) error { func (dst *UUID) Set(src interface{}) error {
if src == nil {
*dst = UUID{Status: pgtype.Null}
return nil
}
switch value := src.(type) { switch value := src.(type) {
case uuid.UUID: case uuid.UUID:
*dst = UUID{UUID: value, Status: pgtype.Present} *dst = UUID{UUID: value, Status: pgtype.Present}