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

Allow unmarshaling to top level maps #273

Merged
merged 3 commits into from
Apr 25, 2019

Conversation

oschwald
Copy link
Contributor

Issue: add link to pelletier/go-toml issue here

This is related to #150, but that seems to be for map[string]interface{}, which this PR does not attempt to address.

Explanation of what this pull request does.

This allows unmarshaling to a top-level map in addition to a struct.

More detailed description of the decisions being made and the reasons why (if the patch is non-trivial).

We were porting code over from the BurntSushi TOML parser and ran into this limitation. The implementation is trivial. I am happy to make changes.

@codecov
Copy link

codecov bot commented Apr 16, 2019

Codecov Report

Merging #273 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #273      +/-   ##
==========================================
+ Coverage   92.02%   92.04%   +0.02%     
==========================================
  Files           9        9              
  Lines        1856     1861       +5     
==========================================
+ Hits         1708     1713       +5     
  Misses        103      103              
  Partials       45       45
Impacted Files Coverage Δ
marshal.go 90.97% <100%> (+0.1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 65b27e6...8cc41e5. Read the comment docs.

@pelletier pelletier merged commit 1d8903f into pelletier:master Apr 25, 2019
@pelletier
Copy link
Owner

Thank you for your pull request! Added a couple tests and merged.

@pelletier
Copy link
Owner

Feel free to submit provide additional patches and/or record issues as you transition from BurntSushi TOML. If you don't mind me asking, what are your motivations to do so?

@oschwald
Copy link
Contributor Author

Thank you! We have found that the BurntSushi parser panics on quite a few error conditions. Some of these are fixed in various PRs, but the project seems much less actively maintained. I think BurntSushi primary does Rust nowadays.

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.

2 participants