You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
codec.Marshaler and codec.ProtoMarshaler have similar name but totally different responsibility.
Problem Definition
codec.ProtoMarshaler, similar to json.Marshaler, is for self marshaling. codec.Marshaler, on the other hand, is for marshaling other objects. Reading the name I would assume that both are of the same kind, but they have completely different responsibility.
How about we rename codec.Marshaler -> codec.Codec since the two implementations are ProtoCodec and AminoCodec. And similarly BinaryMarshaler and JSONMarshaler become BinaryCodec and JSONCodec.
Summary
codec.Marshaler
andcodec.ProtoMarshaler
have similar name but totally different responsibility.Problem Definition
codec.ProtoMarshaler
, similar tojson.Marshaler
, is for self marshaling.codec.Marshaler
, on the other hand, is for marshaling other objects. Reading the name I would assume that both are of the same kind, but they have completely different responsibility.Proposal
Two options:
codec.ProtoMarshaler
tocodec.Coder
proto.Marshal
-> ref: Useproto.Marshal
for store objects Marshaling #8412For Admin Use
The text was updated successfully, but these errors were encountered: