From ad820b0b26665b48003df0710cd11add61bba3e3 Mon Sep 17 00:00:00 2001 From: Kensei Nakada <44139130+sanposhiho@users.noreply.github.com> Date: Sat, 15 May 2021 00:18:42 +0900 Subject: [PATCH] update Finish docs for Go1.14+ (#556) --- gomock/controller.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gomock/controller.go b/gomock/controller.go index 3b656909..f054200d 100644 --- a/gomock/controller.go +++ b/gomock/controller.go @@ -123,7 +123,7 @@ type Controller struct { // Controller. // // New in go1.14+, if you are passing a *testing.T into this function you no -// longer need to call ctrl.Finish() in your test methods +// longer need to call ctrl.Finish() in your test methods. func NewController(t TestReporter) *Controller { h, ok := t.(TestHelper) if !ok { @@ -259,6 +259,9 @@ func (ctrl *Controller) Call(receiver interface{}, method string, args ...interf // Finish checks to see if all the methods that were expected to be called // were called. It should be invoked for each Controller. It is not idempotent // and therefore can only be invoked once. +// +// New in go1.14+, if you are passing a *testing.T into NewController function you no +// longer need to call ctrl.Finish() in your test methods. func (ctrl *Controller) Finish() { // If we're currently panicking, probably because this is a deferred call. // This must be recovered in the deferred function.