package json12import "errors"34// Message is a raw encoded JSON value.5// It implements [Marshaler] and [Unmarshaler] and can6// be used to delay JSON decoding or precompute a JSON encoding.7//8// Copied from: https://cs.opensource.google/go/go/+/refs/tags/go1.23.6:src/encoding/json/stream.go;l=256-2769type Message []byte1011// MarshalJSON returns m as the JSON encoding of m.12//13// Copied from: https://cs.opensource.google/go/go/+/refs/tags/go1.23.6:src/encoding/json/stream.go;l=256-27614func (m Message) MarshalJSON() ([]byte, error) {15if m == nil {16return []byte("null"), nil17}18return m, nil19}2021// UnmarshalJSON sets *m to a copy of data.22//23// Copied from: https://cs.opensource.google/go/go/+/refs/tags/go1.23.6:src/encoding/json/stream.go;l=256-27624func (m *Message) UnmarshalJSON(data []byte) error {25if m == nil {26return errors.New("json.Message: UnmarshalJSON on nil pointer")27}28*m = append((*m)[0:0], data...)29return nil30}313233