Scan implements the sql.Scanner interface.
(src interface{})
| 82 | |
| 83 | // Scan implements the sql.Scanner interface. |
| 84 | func (u *NullUUID) Scan(src interface{}) error { |
| 85 | if src == nil { |
| 86 | u.UUID, u.Valid = Nil, false |
| 87 | return nil |
| 88 | } |
| 89 | |
| 90 | // Delegate to UUID Scan function |
| 91 | u.Valid = true |
| 92 | return u.UUID.Scan(src) |
| 93 | } |
| 94 | |
| 95 | // MarshalJSON marshals the NullUUID as null or the nested UUID |
| 96 | func (u NullUUID) MarshalJSON() ([]byte, error) { |