Unmarshal deserializes a type from the given byte representation using gogo protobuf serialization rules. It is backwards-compatible with formats used by older versions of CRDB. var t T err := protoutil.Unmarshal(data, &t) Unmarshal is part of the protoutil.Message interface.
(data []byte)
| 2442 | // |
| 2443 | // Unmarshal is part of the protoutil.Message interface. |
| 2444 | func (t *T) Unmarshal(data []byte) error { |
| 2445 | // Unmarshal the internal type, and then perform an upgrade step to convert |
| 2446 | // to the latest format. |
| 2447 | err := protoutil.Unmarshal(data, &t.InternalType) |
| 2448 | if err != nil { |
| 2449 | return err |
| 2450 | } |
| 2451 | return t.upgradeType() |
| 2452 | } |
| 2453 | |
| 2454 | // upgradeType assumes its input was just unmarshaled from bytes that may have |
| 2455 | // been serialized by any previous version of CRDB. It upgrades the object |
nothing calls this directly
no test coverage detected