-
Notifications
You must be signed in to change notification settings - Fork 100
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
Register Go int as long in type resolver #423
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ func NewTypeResolver() *TypeResolver { | |
r.Register(string(Int), int16(0)) | ||
r.Register(string(Int), int32(0)) | ||
r.Register(string(Int), int(0)) | ||
r.Register(string(Long), int(0)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this only be for 64 but systems? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think so, let me explain. In case of encoding, you can encode Now, in the case of decoding it's only safe to decode There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair point |
||
r.Register(string(Long), int64(0)) | ||
r.Register(string(Float), float32(0)) | ||
r.Register(string(Double), float64(0)) | ||
|
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.
I didn't find any tests testing this behavior so I added it, specifically the test case
Go int as Avro long
tests the line added in this PR. It's written in a different style than the other tests in this repo, if you prefer I can split it up into separate tests.