From 11d9cab23e050dd7d3d6a595ca84348ffdb5add0 Mon Sep 17 00:00:00 2001 From: Cody Oss <6331106+codyoss@users.noreply.github.com> Date: Fri, 31 Jul 2020 10:38:53 -0600 Subject: [PATCH] fix readme docs on removing Finish calls (#461) This feature has not yet been released so users need to pull @master if they would like to enable it for now. --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 897f34df..eff0a467 100644 --- a/README.md +++ b/README.md @@ -141,8 +141,10 @@ func TestFoo(t *testing.T) { } ``` -In Go versions 1.14+, if you pass a *testing.T into `gomock.NewController(t)` -you no longer need to call `ctrl.Finish()`. +If you are using a Go version of 1.14+, a mockgen version of 1.5.0+, and are +passing a *testing.T into `gomock.NewController(t)` you no longer need to call +`ctrl.Finish()` explicitly. It will be called for you automatically from a self +registered [Cleanup](https://pkg.go.dev/testing?tab=doc#T.Cleanup) function. Building Stubs --------------