Skip to content

Commit 8d4dcbb

Browse files
Merge pull request #1569 from stretchr/mock-more-AnythingOfTypeArgument-alternatives
mock: document more alternatives to deprecated AnythingOfTypeArgument
2 parents f32ff5b + 8c324a0 commit 8d4dcbb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎mock/mock.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,15 @@ const (
766766
// AnythingOfTypeArgument contains the type of an argument
767767
// for use when type checking. Used in [Arguments.Diff] and [Arguments.Assert].
768768
//
769-
// Deprecated: this is an implementation detail that must not be used. Use [AnythingOfType] instead.
769+
// Deprecated: this is an implementation detail that must not be used. Use the [AnythingOfType] constructor instead, example:
770+
//
771+
// m.On("Do", mock.AnythingOfType("string"))
772+
//
773+
// All explicit type declarations can be replaced with interface{} as is expected by [Mock.On], example:
774+
//
775+
// func anyString interface{} {
776+
// return mock.AnythingOfType("string")
777+
// }
770778
type AnythingOfTypeArgument = anythingOfTypeArgument
771779

772780
// anythingOfTypeArgument is a string that contains the type of an argument

0 commit comments

Comments
 (0)