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

checkCondition should handle []interface{} for intersect operations #3718

Closed
moorereason opened this issue Jul 19, 2017 · 1 comment · Fixed by #3746
Closed

checkCondition should handle []interface{} for intersect operations #3718

moorereason opened this issue Jul 19, 2017 · 1 comment · Fixed by #3746

Comments

@moorereason
Copy link
Contributor

The following new test cases fail in TestCheckCondition:

{reflect.ValueOf([]interface{}{"a"}), reflect.ValueOf([]string{"a", "b"}), "intersect", expect{true, false}},
{reflect.ValueOf([]string{"a"}), reflect.ValueOf([]interface{}{"a", "b"}), "intersect", expect{true, false}},

The issue is that checkCondition only sets slv and slmv (L106) if v and mv are of the same type (L85); therefore, the eventual call to ns.Intersect (L205) is made with two nil params.

See discussion thread for use case and rationale: https://discourse.gohugo.io/t/7435

Test site from @budparr: https://github.com/budparr/Test-Case-for-defining-relationships-across-sections/blob/master/layouts/index.html

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant