veraison / corim

CoRIM and CoMID manipulation library and CLI
Apache License 2.0
9 stars 7 forks source link

fix: use value receivers for MarshalXXX methods #117

Closed setrofim closed 5 months ago

setrofim commented 5 months ago

Use value, rather than pointer, receivers for MarshalCBOR and MarshalJSON methods. Since those methods don't mutate the structures, pointers are not necessary, and using them prevents the methods from being invoked when marshaling an instance of that structure (rather than a pointer to one). This is not a huge deal as CoRIM fields typically use pointers, however it can lead to surprising results when playing with the structures on their own.