-
Notifications
You must be signed in to change notification settings - Fork 627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MsgPack Marshal and Unmarshal function(Add Test Case And Change return value to unnamed) #263
base: master
Are you sure you want to change the base?
Conversation
Mote: Marshal max digits is 30. it decimal.IntPart large than 30,it will be lose extra digits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.