MarshalJSON implements the [json.Marshaler] interface.
()
| 25 | |
| 26 | // MarshalJSON implements the [json.Marshaler] interface. |
| 27 | func (j JSONRaw) MarshalJSON() ([]byte, error) { |
| 28 | if len(j) == 0 { |
| 29 | return []byte("null"), nil |
| 30 | } |
| 31 | |
| 32 | return j, nil |
| 33 | } |
| 34 | |
| 35 | // UnmarshalJSON implements the [json.Unmarshaler] interface. |
| 36 | func (j *JSONRaw) UnmarshalJSON(b []byte) error { |
no outgoing calls