diff --git a/filters/matcher.go b/filters/matcher.go index 8013fcaa3..8b0a82a1c 100644 --- a/filters/matcher.go +++ b/filters/matcher.go @@ -23,10 +23,6 @@ type abstractMatcher struct { Operator string } -func (matcher *abstractMatcher) setOperator(operator string) { - matcher.Operator = operator -} - func (matcher *abstractMatcher) GetOperator() string { return matcher.Operator } @@ -123,7 +119,6 @@ func (matcher *negativeRegexMatcher) Compare(valA, valB interface{}) bool { func newMatcher(matchType string) (matcherT, error) { if m, found := matcherConfig[matchType]; found { - m.setOperator(matchType) return m, nil } e := fmt.Sprintf("%s not matched with any know match type", matchType) diff --git a/filters/registry.go b/filters/registry.go index 88073ceca..8f706015d 100644 --- a/filters/registry.go +++ b/filters/registry.go @@ -21,12 +21,12 @@ var matcherRegex = "[=!<>~]+" var filterRegex = "^(@)?[a-zA-Z_][a-zA-Z0-9_]*" var matcherConfig = map[string]matcherT{ - equalOperator: &equalMatcher{}, - notEqualOperator: ¬EqualMatcher{}, - moreThanOperator: &moreThanMatcher{}, - lessThanOperator: &lessThanMatcher{}, - regexpOperator: ®expMatcher{}, - negativeRegexOperator: &negativeRegexMatcher{}, + equalOperator: &equalMatcher{abstractMatcher{Operator: equalOperator}}, + notEqualOperator: ¬EqualMatcher{abstractMatcher{Operator: notEqualOperator}}, + moreThanOperator: &moreThanMatcher{abstractMatcher{Operator: moreThanOperator}}, + lessThanOperator: &lessThanMatcher{abstractMatcher{Operator: lessThanOperator}}, + regexpOperator: ®expMatcher{abstractMatcher{Operator: regexpOperator}}, + negativeRegexOperator: &negativeRegexMatcher{abstractMatcher{Operator: negativeRegexOperator}}, } type filterConfig struct {