Scan implements the sql.Scanner interface.
(src interface{})
| 63 | |
| 64 | // Scan implements the sql.Scanner interface. |
| 65 | func (u *NullUUID) Scan(src interface{}) error { |
| 66 | if src == nil { |
| 67 | u.UUID, u.Valid = Nil, false |
| 68 | return nil |
| 69 | } |
| 70 | |
| 71 | // Delegate to UUID Scan function |
| 72 | u.Valid = true |
| 73 | return u.UUID.Scan(src) |
| 74 | } |
| 75 | |
| 76 | // MarshalJSON marshals the NullUUID as null or the nested UUID |
| 77 | func (u NullUUID) MarshalJSON() ([]byte, error) { |