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 empty trees when using OrderPreserve #539

Merged
merged 2 commits into from
May 11, 2021
Merged

Conversation

Felixoid
Copy link
Contributor

@Felixoid Felixoid commented May 10, 2021

Issue: fixes #450

Empty trees cause overriding of any existing node with line 0. It's not fixing the mentioned issue completely, although it works 100% for the case I've faced today during playing around with the library.

@Felixoid
Copy link
Contributor Author

I'd like to add the test to cover my case as well, so I am converting it to the draft for now

@Felixoid Felixoid marked this pull request as draft May 10, 2021 23:48
@Felixoid
Copy link
Contributor Author

Hey dear @pelletier. Thank you for a great product!

I'd like to get it reviewed.

@pelletier
Copy link
Owner

Looks good! Thank you very much for the patch!

@pelletier pelletier merged commit c893dbf into pelletier:master May 11, 2021
@Felixoid
Copy link
Contributor Author

Oh, that's quick =)

Do you mind create a new release with this fix, please?

@pelletier pelletier changed the title Return non-zero for empty trees from getTreeArrayLine Fix empty trees when using OrderPreserve May 11, 2021
@pelletier
Copy link
Owner

Done! https://github.com/pelletier/go-toml/releases/tag/v1.9.1

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.

Ordered-Marshal doesn't give the correct order and in certain cases duplicates the path after using SetPath
2 participants