Merge pull request #1569 from stretchr/mock-more-AnythingOfTypeArgument-alternatives

mock: document more alternatives to deprecated AnythingOfTypeArgument
This commit is contained in:
Bracken 2024-04-23 16:15:28 +00:00 committed by GitHub
commit 8d4dcbbccb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -766,7 +766,15 @@ const (
// AnythingOfTypeArgument contains the type of an argument // AnythingOfTypeArgument contains the type of an argument
// for use when type checking. Used in [Arguments.Diff] and [Arguments.Assert]. // for use when type checking. Used in [Arguments.Diff] and [Arguments.Assert].
// //
// Deprecated: this is an implementation detail that must not be used. Use [AnythingOfType] instead. // Deprecated: this is an implementation detail that must not be used. Use the [AnythingOfType] constructor instead, example:
//
// m.On("Do", mock.AnythingOfType("string"))
//
// All explicit type declarations can be replaced with interface{} as is expected by [Mock.On], example:
//
// func anyString interface{} {
// return mock.AnythingOfType("string")
// }
type AnythingOfTypeArgument = anythingOfTypeArgument type AnythingOfTypeArgument = anythingOfTypeArgument
// anythingOfTypeArgument is a string that contains the type of an argument // anythingOfTypeArgument is a string that contains the type of an argument