Add MsgPack Marshal and Unmarshal function(Add Test Case And Change return value to unnamed)#263
Add MsgPack Marshal and Unmarshal function(Add Test Case And Change return value to unnamed)#263piyongcai wants to merge 6 commits intoshopspring:masterfrom
Conversation
Mote: Marshal max digits is 30. it decimal.IntPart large than 30,it will be lose extra digits.
mwoss
left a comment
There was a problem hiding this comment.
Before diving into the implementation I would like to see a few unit tests. They are handy in case of any refactors, bug catching and implementation changes that could happened in the future
decimal_msgpack.go
Outdated
| } | ||
|
|
||
| // UnmarshalMsg implements msgp.Unmarshaler | ||
| func (d *Decimal) UnmarshalMsg(b []byte) (o []byte, err error) { |
There was a problem hiding this comment.
Could you stick to one type of return value (names/unnamed)? Across the entire library, we use an unnamed one, so I personally opt for this approach.
There was a problem hiding this comment.
already Change MsgPack MarshalMsg and UnmarshalMsg function's return value to unnamed.
Test Case was added. |
|
Thanks for providing test cases @piyongcai :) I will try to review your code later this week or next to one, as I need to get familiarized with MsgPack before doing a proper review. |
Note: Marshal max digits is 31. it decimal.IntPart large than 31,it will be lose extra digits.