Description

MatchedBy can be used to match a mock call based on only certain properties from a complex struct or some calculation. It takes a function that will be evaluated with the called argument and will return true when there's a match and false otherwise.

Example: m.On("Do", MatchedBy(func(req *http.Request) bool { return req.Host == "example.com" }))

|fn|, must be a function accepting a single argument (of the expected type) which returns a bool. If |fn| doesn't match the required signature, MathedBy() panics.