Closed kc1212 closed 6 years ago
I can see two possible solutions,
1: in Encode
, just before returning en.Bytes()
, we can check its length, and iff it's 0, it means there were no serializable fields
2: in (en *encoder) message
, if no field.CanSet()
was true in the loop, we can do something. However, similarly to the issue #30 no other method than Encode
can return errors.
Currently structs with all private fields would get serialised without error, but it would contain no data. We should throw an error instead.