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

Fixing bug with 'has' and 'datasource' around referencing sub-maps in nested maps #135

Merged
merged 1 commit into from May 6, 2017

Conversation

hairyhenderson
Copy link
Owner

@hairyhenderson hairyhenderson commented May 6, 2017

Fixes #134

This loosens the signature of has so that any map can be provided. It means using reflect (😨), but I think it's necessary in this case.

I also found an issue where {{ (ds "d").foo.bar }} would fail, so I fixed that. The fix involved moving from json.Unmarshal to yaml.Unmarshal - seems they behave slightly differently. This is just fine, given that YAML is a superset of JSON. The only catch is that the parser isn't as strict so things that failed to parse before will now parse... ¯\_(ツ)_/¯

Signed-off-by: Dave Henderson dhenderson@gmail.com

… nested maps

Signed-off-by: Dave Henderson <dhenderson@gmail.com>
@hairyhenderson hairyhenderson merged commit b895176 into master May 6, 2017
@hairyhenderson hairyhenderson deleted the fix-nested-map-bugs-134 branch May 6, 2017 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

function "has" will panic when used on nested map
1 participant