Matcher objects, when using the LookupMatcher function, can be used for additional checks and to override the default result in case of path matches. The argument passed to the Match function is the original value passed to the Tree.Add function.
| 16 | // default result in case of path matches. The argument passed to the Match function is the original value |
| 17 | // passed to the Tree.Add function. |
| 18 | type Matcher interface { |
| 19 | |
| 20 | // Match should return true and the object to be returned by the lookup, when the argument value fulfils the |
| 21 | // conditions defined by the custom logic in the matcher itself. If it returns false, it instructs the |
| 22 | // lookup to continue with backtracking from the current tree position. |
| 23 | Match(value interface{}) (bool, interface{}) |
| 24 | } |
| 25 | |
| 26 | type trueMatcher struct{} |
| 27 |
no outgoing calls
no test coverage detected
searching dependent graphs…