Skip to content

Mock for signatures #205

@tulzke

Description

@tulzke

We need the ability to create mocks for signature, not just for interfaces.
It can be usually in cases, where we use callback functions.
Example:

type RunFunc func(ctx context.Context) error

type Runner struct {
  // ...
  run RunFunc // cannot mock this function now
}

I don't want to use interface here, because it imposes a restriction on the name of the method. All I need is a contract match.

Feature request from old gomock: golang/mock#519

Same feature is available in mockery now

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions