points by agosz 12 hours ago | 0 comments
If you do version and size as the first two fields, you're basically there to backwards and forwards compatibility. Callers can request the size of the struct, allocate a buffer, and read out the parts they need. They can also check specific versions for what they support and ignore newer versions.
It also helps if you only append to the end of the struct for newer fields.
Aún no hay comentarios.