This repository has been archived by the owner on Jun 27, 2023. It is now read-only.
Support type-safe Do()
and DoAndReturn()
methods
#634
Labels
Do()
and DoAndReturn()
methods
#634
Requested feature
Similar to #622, having a type-safe
Do()
andDoAndReturn()
:Do()
andDoAndReturn()
code with autocomplete and type checksGiven the interface:
gomock generates the following methods:
Therefore, any function (even when it doesn't match the original interface's method signature) can be passed to
Do()
andDoAndReturn()
risking a runtime error and making it difficult to refactor method signatures effectively.Proposed Solution
Based on the example of, the following should become the signatures of
Do()
andDoAndReturn()
of the generated mock:The text was updated successfully, but these errors were encountered: