Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
update Finish docs for Go1.14+ (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanposhiho committed May 14, 2021
1 parent bb5fd5e commit ad820b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gomock/controller.go
Expand Up @@ -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 {
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit ad820b0

Please sign in to comment.