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 ToMap for tables in nested mixed-type arrays #455

Closed
wants to merge 1 commit into from

Conversation

mstetson
Copy link
Contributor

I wasn't thorough enough in my earlier PR. #453 fixed tables in mixed arrays, but only in the top-level array, not in any nested array. This updated fix scans arrays recursively looking for tables. It supports constructs like this:

UglyValue = ["blah", [
    {foo = "bar"},
    {baz = "quux"},
]]

@codecov
Copy link

codecov bot commented Nov 19, 2020

Codecov Report

Merging #455 (6642afc) into master (1bd9461) will decrease coverage by 0.08%.
The diff coverage is 81.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #455      +/-   ##
==========================================
- Coverage   93.60%   93.51%   -0.09%     
==========================================
  Files          10       10              
  Lines        2268     2268              
==========================================
- Hits         2123     2121       -2     
- Misses        105      106       +1     
- Partials       40       41       +1     
Impacted Files Coverage Δ
tomltree_write.go 94.15% <81.81%> (-0.65%) ⬇️

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 1bd9461...6642afc. Read the comment docs.

@pelletier
Copy link
Owner

Thanks! Is there a case where this branch is taken?

	if tv, ok := v.(*tomlValue); ok {
		v = tv.value
	}

If yes it's probably worth a test, if not we can get rid of the code :)

@pelletier
Copy link
Owner

Merged with #461

Thank you!

@pelletier pelletier closed this Jan 7, 2021
@mstetson
Copy link
Contributor Author

mstetson commented Jan 7, 2021

Thanks! Sorry I left you hanging there.

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