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

Method MarshalTo

pkg/sql/types/types.go:1793–1799  ·  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

1791//
1792// Marshal is part of the protoutil.Message interface.
1793func (t *T) MarshalTo(data []byte) (int, error) {
1794 temp := *t
1795 if err := temp.downgradeType(); err != nil {
1796 return 0, err
1797 }
1798 return temp.InternalType.MarshalTo(data)
1799}
1800
1801// of the latest CRDB version. It updates the fields so that they will be
1802// 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