uber-go / mock

GoMock is a mocking framework for the Go programming language.
Apache License 2.0
1.82k stars 104 forks source link

`nil` value `TestReporter` in `NewController` #99

Open cyrusv opened 9 months ago

cyrusv commented 9 months ago

Is this allowed or not? It does not throw an error right away, but opens the door for NPEs in methods like (h *nopTestHelper) Errorf(. I understand it might be backwards incompat to start enforcing now, so it is a constraint we can relax, or at least document?

r-hang commented 9 months ago

I believe that we should support a nil input but rework the logic of the nopTestHelper to have an actual nop implementation instead of something that would panic.