Skip to content

vararg "_" in interface is mocked incorrectly #265

@TvdW

Description

@TvdW

The docker API client code contains an interesting interface:

...
	ImageInspect(ctx context.Context, image string, _ ...ImageInspectOption) (image.InspectResponse, error)
	ImageHistory(ctx context.Context, image string, _ ...ImageHistoryOption) ([]image.HistoryResponseItem, error)
	ImageLoad(ctx context.Context, input io.Reader, _ ...ImageLoadOption) (image.LoadResponse, error)
	ImageSave(ctx context.Context, images []string, _ ...ImageSaveOption) (io.ReadCloser, error)
...

While these are accepted on an interface, they cannot be named _ on the implementation.

Actual behavior

The resulting mock cannot be used

Expected behavior

It should be usable (_ renamed to arg%d)

To Reproduce

  1. Attempt to mock the Docker API

Additional Information

Running code at HEAD

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