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 an issues where pointers were causing a key to be recorded twice #185

Merged
merged 1 commit into from Apr 27, 2020

Conversation

@mkeeler
Copy link
Contributor

@mkeeler mkeeler commented Apr 27, 2020

The issue I was running into was that for pointer fields in a struct the key was being recorded twice in the Metadata.Keys list. There are some cases where decodePtr will recurse into another call to decode which will add the field. However the outer decode call was unconditionally adding the field as well.

The updates in this PR change the behavior to only add the pointer fields name to the list of keys if no recursion was performed.

@mitchellh mitchellh merged commit c1405a8 into mitchellh:master Apr 27, 2020
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants