Skip to content

Combining ​

Combining ​

GoMock fileMatches
All(ms...)allWhat every matcher matches: [all, [[gt, 1], [lt, 9]]].
Any(ms...)anyWhat some matcher matches.
Both(a, b), Either(a, b), XOR(a, b)both, either, xorWhat both, either, or exactly one of two matchers match.
Not(m)notWhat m doesn't match.

In Go only ​

MatcherMatches
Function(fn), Predicate(fn)What a function reports true for.
Peek(m, action)What m matches, running action on the value first, such as to log it.

To use a matcher of your own in mock files, register it: see Custom matchers.