UnmarshalText implements encoding.TextUnmarshaler.
(data []byte)
| 87 | |
| 88 | // UnmarshalText implements encoding.TextUnmarshaler. |
| 89 | func (nu *NullUUID) UnmarshalText(data []byte) error { |
| 90 | id, err := ParseBytes(data) |
| 91 | if err != nil { |
| 92 | nu.Valid = false |
| 93 | return err |
| 94 | } |
| 95 | nu.UUID = id |
| 96 | nu.Valid = true |
| 97 | return nil |
| 98 | } |
| 99 | |
| 100 | // MarshalJSON implements json.Marshaler. |
| 101 | func (nu NullUUID) MarshalJSON() ([]byte, error) { |
nothing calls this directly
no test coverage detected