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.

Breaking change introduced in #558 #571

@iamhopaul123

Description

@iamhopaul123

Actual behavior A clear and concise description of what the bug is.

After #558, it forces a check for the number of argument for Do function. However, it doesn't work for variadic params. For example we have

UpdateAndWait(name, template string, opts ...stackset.CreateOrUpdateOption) error

and in the unit test we check

m.EXPECT().UpdateAndWait(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
	Return(nil).
	Do(func(_, template string, _, _, _, _, _ stackset.CreateOrUpdateOption) {
		configToDeploy, err := stack.AppConfigFrom(&template)
		require.NoError(t, err)
		require.ElementsMatch(t, []string{"firsttest"}, configToDeploy.Services)
		require.Empty(t, configToDeploy.Accounts, "config account list should be empty")
		require.Equal(t, 2, configToDeploy.Version)
	})

simply there's no way for us to use Do to validate one of the variadic param we pass.

Additional Information

  • gomock mode (reflect or source):
  • gomock version or git ref: v1.6.0
  • golang version: go1.16.4 darwin/amd64

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