Remove redundant defer ctrl.Finish()
Recipe ID
org.openrewrite.golang.migration.RemoveRedundantGomockFinishArtifactgithub.com/moderneinc/recipes-goRemove defer ctrl.Finish() where the controller was built by gomock.NewController from a *testing.T, *testing.B, *testing.F or testing.TB. NewController registers the finish through Cleanup for any such reporter, so the deferred call only repeats it.
Single recipeProprietary
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.golang.migration.RemoveRedundantGomockFinishIf the recipe isn’t available locally, install it with:
mod config recipes go install github.com/moderneinc/recipes-go