uber-go / mock

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

Support type-safe InOrder and After #77

Closed EstebanOlmedo closed 1 year ago

EstebanOlmedo commented 1 year ago

Currently when type-safe return values are used, one can't use InOrder neither After with them as they expect *gomock.Call as parameters. This changes the type these functions expect to be an interface which implements the GetCall() *Call method, which returns the embedded *gomock.Call type for generated mock types.

Using this approach helps to have compile-time error/warnings instead of runtime errors with a reflection based solution.

Fixes (#70)

sywhang commented 1 year ago

Let's go with the approach #78 instead.

The addition of this CallWrapper interface is undesirable, when it's not necessary to add this.

@marten-seemann could you try with #78 instead?