12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package oglematchers
- func NewMatcher(
- predicate func(interface{}) error,
- description string) Matcher {
- return &predicateMatcher{
- predicate: predicate,
- description: description,
- }
- }
- type predicateMatcher struct {
- predicate func(interface{}) error
- description string
- }
- func (pm *predicateMatcher) Matches(c interface{}) error {
- return pm.predicate(c)
- }
- func (pm *predicateMatcher) Description() string {
- return pm.description
- }
|