Skip to content

Commit

Permalink
mock: document more alternatives to deprecated AnythingOfTypeArgument
Browse files Browse the repository at this point in the history
  • Loading branch information
dolmen committed Mar 7, 2024
1 parent 632a260 commit aca1890
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion mock/mock.go
Expand Up @@ -766,7 +766,25 @@ const (
// AnythingOfTypeArgument contains the type of an argument
// for use when type checking. Used in Diff and 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.
//
// If AnythingOfTypeArgument is used as a function return value type you can usually replace
// the function with a variable. Example:
//
// func anyString() mock.AnythingOfTypeArgument {
// return mock.AnythingOfType("string")
// }
//
// Can be replaced by:
//
// func anyString() interface{} {
// return mock.IsType("")
// }
//
// It could even be replaced with a variable:
//
// var anyString = mock.AnythingOfType("string")
// var anyString = mock.IsType("") // alternative
type AnythingOfTypeArgument = anythingOfTypeArgument

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

0 comments on commit aca1890

Please sign in to comment.