MarshalJSON implements JSON serialization of IDs.
()
| 25 | |
| 26 | // MarshalJSON implements JSON serialization of IDs. |
| 27 | func (i ID) MarshalJSON() ([]byte, error) { |
| 28 | s := i.String() |
| 29 | |
| 30 | //nolint:wrapcheck |
| 31 | return json.Marshal(s) |
| 32 | } |
| 33 | |
| 34 | // UnmarshalJSON implements JSON deserialization of IDs. |
| 35 | func (i *ID) UnmarshalJSON(v []byte) error { |