Closed riptl closed 1 year ago
Assuming that you are ok with []byte
, you may use serde_bytes
in Rust so that the schema uses the primitive type Bytes
. Then, the code generator will create a []byte
in Go:
https://github.com/zefchain/serde-reflection/blob/main/serde-generate/src/golang.rs#L222
If you want [32]byte
, then the answer is more complicated. Probably just add conversion methods to and from [32]uint8
in Go. There are ways to inject custom code during code generation.
I'm going to close the issue. Few languages have static-size arrays and Rust doesn't have a Byte
type anyway.
🚀 Feature Request
Motivation
Code generation is inefficient for static size byte arrays
generates
Pitch
Describe the solution you'd like
Describe alternatives you've considered
none
Are you willing to open a pull request? (See CONTRIBUTING)
Maybe later
Additional context