-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Initial binding cleanup using generics #5408
Conversation
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.
Thanks for this, it looks good indeed - cool stuff.
I've made a comment inline as the test changes seem unnecessary.
On a side note (unimportant) the gen script could have been updated to generate all the API in its original place leading to a clearer diff. With this approach we have to rely on the tests to verify that the function signatures are the same as they were before.
data/binding/preference_test.go
Outdated
var wg sync.WaitGroup | ||
wg.Add(n) |
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.
Isn't this considered bad practice? I thought I read you should only increment as each item is added
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.
Anyhow I'd be tempted to say that in a refactor like this I'd prefer to see no test changes ;)
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.
Yeah, this seems like some sort of thing that I accidentally committed after some race fix testing. I have no idea what is the best practice. The official example adds one at a time but I also can't find anything to say that adding them all at once would be bad. It is certainly faster 😅
Thanks. Yeah, I noticed that too late and the test change was not meant to be there. Will fix :) |
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.
Sweet thanks so much!
Description:
I honestly should be studying but I couldn't hold my self back with this one. The cleanup gains are too substantial.
For #5378
Checklist: