1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- package oglematchers
- import (
- "errors"
- "fmt"
- )
- func Not(m Matcher) Matcher {
- return ¬Matcher{m}
- }
- type notMatcher struct {
- wrapped Matcher
- }
- func (m *notMatcher) Matches(c interface{}) (err error) {
- err = m.wrapped.Matches(c)
-
- if err == nil {
- return errors.New("")
- }
-
- if _, isFatal := err.(*FatalError); isFatal {
- return err
- }
-
- return nil
- }
- func (m *notMatcher) Description() string {
- return fmt.Sprintf("not(%s)", m.wrapped.Description())
- }
|