-
Notifications
You must be signed in to change notification settings - Fork 212
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
Encode: support json.Number
type
#923
Conversation
@pelletier this PR looks ready for another pass and hopefully (squash) merge it into |
Thanks for pushing this! I've added a warning on the method to warn that it is not considered as stable as the rest of the go-toml API. Initially I wanted to have it moved to the |
// SetMarshalJsonNumbers forces the encoder to serialize `json.Number` as a | ||
// float or integer instead of relying on TextMarshaler to emit a string. | ||
// | ||
// *Unstable:* This method does not follow the compatiblity guarnatees of |
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.
small typo: s/guarnatees/guarantees/
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.
🤦🏻♂️ good catch, thank you #927
json.Number
type
Adds encoding support for
json.Number
and fixes #897On a side note, I am currently porting a codebase that uses https://github.com/BurntSushi/toml and the lack of encoding support for
json.Number
type in go-toml neat library was a blocker.Paste
benchstat
results here