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

Removes calls to ctrl.Finish #1803

Merged
merged 3 commits into from
Aug 3, 2023
Merged

Removes calls to ctrl.Finish #1803

merged 3 commits into from
Aug 3, 2023

Conversation

darioush
Copy link
Contributor

@darioush darioush commented Aug 2, 2023

Why this should be merged

Removes unneeded code to make tests easier to read.

How this works

@joshua-kim found out that since go1.14+ it's not needed to call defer ctrl.Finish() if you pass t to the controller initialization. Docs: https://pkg.go.dev/github.com/golang/mock/gomock#Controller.Finish
The gomock library uses the t.Cleanup() pattern instead.

How this was tested

UTs

@StephenButtolph StephenButtolph added the cleanup Code quality improvement label Aug 2, 2023
@StephenButtolph StephenButtolph added this to the v1.10.7 milestone Aug 2, 2023
@StephenButtolph StephenButtolph changed the base branch from master to dev August 3, 2023 00:06
@StephenButtolph StephenButtolph merged commit dc16f3a into dev Aug 3, 2023
13 checks passed
@StephenButtolph StephenButtolph deleted the remove-ctrl-finish branch August 3, 2023 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code quality improvement
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants