-
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
Fix Spec field length #310
Conversation
@@ -564,7 +564,8 @@ func CompareStruct( | |||
var compareConfig *ackgenconfig.CompareFieldConfig | |||
// memberFieldPath contains the field path along with the prefix cfg.PrefixConfig.SpecField + "." hence we | |||
// would need to substring to exclude cfg.PrefixConfig.SpecField + "." to get correct field config. | |||
fieldConfig := fieldConfigs[memberFieldPath[len(cfg.PrefixConfig.SpecField) + 1 :len(memberFieldPath)]] | |||
specFieldLen := len(strings.TrimPrefix(cfg.PrefixConfig.SpecField, ".")) |
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.
This fix makes sense, i still wonder what part of elasticache/memorydb delta generated code was broken? can we add some unit tests? :)
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.
I added a new unit test :)
Echoing @a-hilaly here - Please update the PR to include an issue describing the bug this is fixing, or describe the error directly in the PR body. I don't have any context for what this line of code is doing, or should be doing. |
Updated to trim the prefix "." to calculate the length.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nmvk, 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 |
Updated to trim the prefix "." to calculate the length of the
Spec
.cfg.PrefixConfig.SpecField
value is.Spec
so old codelen(cfg.PrefixConfig.SpecField) + 1
constructed incorrect field path and ignored the config set ingenerator.yaml
Added unit test to validate that below block is not generated.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.