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

Type-safe return values #427

@jtyers

Description

@jtyers

Requested feature
I have recently moved from testify/mockery to using GoMock for generating mocks, and simply having the mock aware of the types of my calls is great.

However, the arguments for Return() are always interface{}. Can gomock generate mocks that Return with types that match the underlying method?

This would make refactoring existing code a bit easier as invalid types returned from mocks would be straight compile errors rather than test failures, thus failing faster and with (imo) a clearer error message.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions