package json12// Marshaler is the interface implemented by types that3// can marshal themselves into valid JSON.4type Marshaler interface {5MarshalJSON() ([]byte, error)6}78// Unmarshaler is the interface implemented by types9// that can unmarshal a JSON description of themselves.10// The input can be assumed to be a valid encoding of11// a JSON value. UnmarshalJSON must copy the JSON data12// if it wishes to retain the data after returning.13//14// By convention, to approximate the behavior of [Unmarshal] itself,15// Unmarshalers implement UnmarshalJSON([]byte("null")) as a no-op.16type Unmarshaler interface {17UnmarshalJSON([]byte) error18}1920// JSONCodec is the interface implemented by types that can marshal and21// unmarshal themselves into valid JSON.22type JSONCodec interface {23Marshaler24Unmarshaler25}262728