-
Notifications
You must be signed in to change notification settings - Fork 190
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
Additional nil checks during reference resolution #326
Conversation
// useful to avoid nil pointer panics when accessing the referenced value. | ||
// | ||
// This function only outputs the logical condition and not the "if" block | ||
// so that the output can be reused in many templates, where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a problem with the assumption in the code that all components of the field path point to scalar Go types (or structs). However, this problem is present in the existing code and this PR doesn't need to be held up for it.
@vijtrip2 we can chat about a more robust solution that can handle map and slice field types.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brycahta, jaypipes, vijtrip2 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description of changes:
ReferencesConfig.Path
during reference resolutionmain.go.tpl
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.