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

math/big: big.Int JSON marshalling to/from string #36099

rubensayshi opened this issue Dec 12, 2019 · 1 comment

math/big: big.Int JSON marshalling to/from string #36099

rubensayshi opened this issue Dec 12, 2019 · 1 comment


Copy link

@rubensayshi rubensayshi commented Dec 12, 2019

big.Int by design marshalls / unmarshalls to a number in JSON but for actual BIG numbers this ends up with a mess in other languages, specially javascript ...

Now encoding/json has a ,string struct tag to flag a field to be quoted as a string instead but it's restricted only for strings, floats, integers, and booleans can be quoted. atm.
If this could also be applied to big.Int then we'd have a good solution for BIG numbers without breaking the existing functionality at all!

related; #28154
and there's probably many more people running into this issue...

@ALTree ALTree added this to the Unplanned milestone Dec 12, 2019
Copy link

@AlexanderYastrebov AlexanderYastrebov commented Oct 18, 2021

Somewhat related to #34472


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants