Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gen: fix decoding for non-[]byte types when type-conversion needed
For example for the annotation below: ``` //msgp:shim uuid.UUID as:[]byte using:uuidToBytes/bytesToUUID ``` When an UUID is an array of bytes (and not a slice of bytes). We need to use `uuidToBytes()` call and not hardcoded `[]byte()` cast from the generated func `DecodeMsg(dc *msgp.Reader) error` Ex: ``` func (z *Foobar) DecodeMsg(dc *msgp.Reader) (err error) { [...] case "Id": { var zb0002 []byte - zb0002, err = dc.ReadBytes([]byte(z.Id)) + zb0002, err = dc.ReadBytes(uuidToBytes(z.Id)) ```
- Loading branch information