MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / MarshalTo

Method MarshalTo

pkg/sql/types/types.go:2684–2690  ·  view source on GitHub ↗

MarshalTo behaves like Marshal, except that it deserializes to an existing byte slice and returns the number of bytes written to it. The slice must already have sufficient capacity. Callers can use the Size method to determine how much capacity needs to be allocated. Marshal is part of the protouti

(data []byte)

Source from the content-addressed store, hash-verified

2682//
2683// Marshal is part of the protoutil.Message interface.
2684func (t *T) MarshalTo(data []byte) (int, error) {
2685 temp := *t
2686 if err := temp.downgradeType(); err != nil {
2687 return 0, err
2688 }
2689 return temp.InternalType.MarshalTo(data)
2690}
2691
2692// of the latest CRDB version. It updates the fields so that they will be
2693// marshaled into a format that is compatible with the previous version of

Callers

nothing calls this directly

Calls 2

downgradeTypeMethod · 0.80
MarshalToMethod · 0.65

Tested by

no test coverage detected