Skip to content

Commit

Permalink
Update doc comment
Browse files Browse the repository at this point in the history
It now states that either the container type or element type can be passed to the filter creation instead of forcing it to be the element type.
  • Loading branch information
mkeeler committed Apr 3, 2019
1 parent e78c8a4 commit 553f46d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ func getElementType(dataType interface{}) reflect.Type {
}

// Creates a filter to operate on the given data type.
// The data type is the type of the elements that will be filtered and not the top level container type.
// For example, if you want to filter a []Foo then the data type to pass here is Foo.
// The data type passed can be either be a container type (map, slice or array) or the element type.
// For example, if you want to filter a []Foo then the data type to pass here is either []Foo or just Foo.
// If no expression is provided the nil filter will be returned but is not an error. This is done
// to allow for executing the nil filter which is just a no-op
func CreateFilter(expression string, config *EvaluatorConfig, dataType interface{}) (*Filter, error) {
Expand Down

0 comments on commit 553f46d

Please sign in to comment.