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.

Support variadic methods #68

Closed
Closed
@adamcrume

Description

@adamcrume

I have a method with a printf-like signature: func(string, ...interface{}). When this is mocked and set up with myMock.EXPECT().myFunc(gomock.Any()), then the function is actually called, Call.call panics because len(args) < ft.NumIn(). This is because the generated mock code builds args by flattening the variadic arguments and normal arguments into a single slice, but the reflection API expects the variadic arguments to be wrapped up in a slice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions