Skip to content
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

Fix math/big.Int Does not Marshal #194

Merged
merged 2 commits into from
Apr 26, 2024

Conversation

jeffmitchell-sas
Copy link
Contributor

@jeffmitchell-sas jeffmitchell-sas commented Apr 25, 2024

This is intended to be a fix for #193. ion.MarshalText() returns "{}" for math/big.Int values.

Added BigIntType in type.go. Created func encodeBigInt() in marshal.go and added it to encodeStruct(). Also added unit tests for math/big.Int in marshal_test.go.

@jeffmitchell-sas jeffmitchell-sas changed the title fix mashalling of math/big.Int Fix math/big.Int Does not Marshal Apr 25, 2024
@popematt
Copy link
Contributor

Thanks for contributing this!

It looks like your change will make big.Int marshal correctly, but I'm surprised that you needed to make changes in ion/type.go. We don't want to add a new BigInt type to Ion because in Ion, a "big" int is still an int. Does the marshaling still work if the changes to that file are reverted? TBH, I haven't personally touched this code in quite a while, so I don't actually know if there's something that I'm missing here. I'll need to look into it more.

@jeffmitchell-sas
Copy link
Contributor Author

Good call. I removed the changes in type.go and it still marshalled correctly. I misinterpreted types.go. I reverted the changes to that file. Thanks!

Copy link

codecov bot commented Apr 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (master@caa4fab). Click here to learn what that means.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #194   +/-   ##
=========================================
  Coverage          ?   74.77%           
=========================================
  Files             ?       25           
  Lines             ?     4972           
  Branches          ?        0           
=========================================
  Hits              ?     3718           
  Misses            ?      746           
  Partials          ?      508           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@nirosys nirosys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you Jeff!

@popematt popematt merged commit c017c29 into amazon-ion:master Apr 26, 2024
6 checks passed
@jeffmitchell-sas
Copy link
Contributor Author

Thanks guys!

@jeffmitchell-sas jeffmitchell-sas deleted the fix/issue_193 branch April 26, 2024 23:22
@jeffmitchell-sas
Copy link
Contributor Author

What is the release schedule like? When is the next release normally tagged?

@tgregg
Copy link
Contributor

tgregg commented Apr 26, 2024

What is the release schedule like? When is the next release normally tagged?

I will create a new release by Monday.

@tgregg
Copy link
Contributor

tgregg commented Apr 27, 2024

@jeffmitchell-sas
Copy link
Contributor Author

Thank you @tgregg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants