Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mock: remove aliases to types being deprecated in Testify #229

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dolmen
Copy link

@dolmen dolmen commented Mar 7, 2024

The Testify project has unfortunately exposed types AnythingOfTypeArgument and IsTypeArgument which should have stayed implementation details. They should have been private types hidden behind an interface.
Those types have function constructors that must be used instead:

The references to those concrete types in downstream projects are blocking the cleanup of the Testify API.

appy/mock unfortunately propagate those mistakes. The appy project contains the only public reference to mock.IsTypeArgument on the whole GitHub: https://github.com/search?q=mock.IsTypeArgument+language%3Ago&type=code

... but it is not used beyond being exposed on the appy/mock package.

So this patch just deletes the two references to AnythingOfTypeArgument and IsTypeArgument in package mock.

Note: I'm a co-maintainer of the Testify project.

The Testify project (github.com/stretchr/testify/mock) has unfortunately
exposed types AnythingOfTypeArgument and IsTypeArgument which should
have stayed implementation details. They should have been private types
hidden behind an interface.
Those types have function constructors that must be used instead:
   mock.AnythingOfTypeArgument("string") -> mock.AnythingOfType("string")
   *mock.IsTypeArgument

The references to those concrete types in downstream projects are blocking
the cleanup of the Testify API.

appy/mock unfortunately propagate those mistakes.

The appy project contains the only public reference to
mock.IsTypeArgument on the whole GitHub:

https://github.com/search?q=mock.IsTypeArgument+language%3Ago&type=code

... but it is not used beyond being exposed on the appy/mock package.

So this patch just deletes the two references to AnythingOfTypeArgument
and IsTypeArgument.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant