Skip to content

vararg "_" in interface is mocked incorrectly #265

Open

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

Activity

  1. added 2 commits that reference this issue on Jul 1, 2025
    12dbe2d
    70a3285
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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