-
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
Add Encoder/Decoder types #192
Conversation
7a21193
to
4874ef9
Compare
@pelletier @moorereason feedback? |
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.
This looks good! Not sure how I feel about the file name stream.go
though. I'd just put them in marshal.go
.
3f8dafb
to
44099d4
Compare
I moved the new types into I also made sure the package global |
I will squash once you approve 🙂 |
@robertgzr Seems like you have some conflicts :) Don't worry about squashing, I always squash and merge. |
@pelletier I just wanted to make it easier to look at individual commits but it seems Github doesn't like the first one that deletes |
Go for it! |
44099d4
to
3df5a94
Compare
Usage is similar to the stdlibs JSON encoder/decoder but I tried to leave the general structure of the code the same. Main motivation was to support encoding/decoding options to allow encoding string-type map keys as quoted TOML keys. This was implemented on the Encoder with QuoteMapKeys(bool). > The TOML spec supports using UTF-8 strings as keys. > https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.4.0.md#table
3df5a94
to
d32b181
Compare
Thank you very much for that contribution @robertgzr! |
Usage is similar to the stdlibs JSON encoder/decoder but I tried to
leave the general structure of the code the same.
Main motivation was to support encoding/decoding options to allow
encoding string-type map keys as quoted TOML keys.
This was implemented on the Encoder with QuoteMapKeys(bool).
Replaces #190