Add standard nil test to gofrs-uuid.UUID.Set
This commit is contained in:
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user