-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Find and FindStrict methods to generic lists #129
Conversation
Added strict mode on list search functions/methods Added Find and FindStrict methods to generic lists Added RemoveNil and RemoveEmpty methods to generic lists Added test to cover new functions Simplified the test structure
This looks as a big change, but in fact, a lot of this code is automatically generated by gogenerate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great test coverage :)
Co-authored-by: Denis Blanchette <dblanchette@coveo.com>
Co-authored-by: Denis Blanchette <dblanchette@coveo.com>
Co-authored-by: Denis Blanchette <dblanchette@coveo.com>
Co-authored-by: Denis Blanchette <dblanchette@coveo.com>
template/extra_data.go
Outdated
@@ -189,6 +203,8 @@ var dataFuncsHelp = descriptions{ | |||
"prepend": "Push elements onto the front of a list, creating a new list.", | |||
"rest": "Gets the tail of the list (everything but the first item)", | |||
"reverse": "Produces a new list with the reversed elements of the given list.", | |||
"removeEmpty": "Returns a list will all empty element removed.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"removeEmpty": "Returns a list will all empty element removed.", | |
"removeEmpty": "Returns a list with all empty elements removed.", |
template/extra_data.go
Outdated
@@ -189,6 +203,8 @@ var dataFuncsHelp = descriptions{ | |||
"prepend": "Push elements onto the front of a list, creating a new list.", | |||
"rest": "Gets the tail of the list (everything but the first item)", | |||
"reverse": "Produces a new list with the reversed elements of the given list.", | |||
"removeEmpty": "Returns a list will all empty element removed.", | |||
"removeNil": "Returns a list will all nil element removed.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"removeNil": "Returns a list will all nil element removed.", | |
"removeNil": "Returns a list with all nil elements removed.", |
@@ -163,12 +174,15 @@ var dataFuncsHelp = descriptions{ | |||
"array": "Ensures that the supplied argument is an array (if it is already an array/slice, there is no change, if not, the argument is replaced by []interface{} with a single value).", | |||
"bool": "Converts the `string` into boolean value (`string` must be `True`, `true`, `TRUE`, `1` or `False`, `false`, `FALSE`, `0`)", | |||
"char": "Returns the character corresponging to the supplied integer value", | |||
"contains": "Test to see if a list has a particular elements.", | |||
"contains": "Test to see if a list has a particular elements (matches any types).", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"contains": "Test to see if a list has a particular elements (matches any types).", | |
"contains": "Tests whether a list contains all given elements (matches any types).", |
@@ -163,12 +174,15 @@ var dataFuncsHelp = descriptions{ | |||
"array": "Ensures that the supplied argument is an array (if it is already an array/slice, there is no change, if not, the argument is replaced by []interface{} with a single value).", | |||
"bool": "Converts the `string` into boolean value (`string` must be `True`, `true`, `TRUE`, `1` or `False`, `false`, `FALSE`, `0`)", | |||
"char": "Returns the character corresponging to the supplied integer value", | |||
"contains": "Test to see if a list has a particular elements.", | |||
"contains": "Test to see if a list has a particular elements (matches any types).", | |||
"containsStrict": "Test to see if a list has a particular elements (matches only the same types).", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"containsStrict": "Test to see if a list has a particular elements (matches only the same types).", | |
"containsStrict": "Tests whether a list contains all given elements (matches only the same types).", |
"extract": "Extracts values from a slice or a map, indexes could be either integers for slice or strings for maps", | ||
"get": "Returns the value associated with the supplied map, key and map could be inverted for convenience (i.e. when using piping mode)", | ||
"extract": "Extracts values from a slice or a map, indexes could be either integers for slice or strings for maps.", | ||
"find": "Returns all index position where the element is found in the list (matches any types).", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"find": "Returns all index position where the element is found in the list (matches any types).", | |
"find": "Returns all index positions where the element is found in the list (matches any types).", |
"get": "Returns the value associated with the supplied map, key and map could be inverted for convenience (i.e. when using piping mode)", | ||
"extract": "Extracts values from a slice or a map, indexes could be either integers for slice or strings for maps.", | ||
"find": "Returns all index position where the element is found in the list (matches any types).", | ||
"findStrict": "Returns all index position where the element is found in the list (matches only the same types).", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"findStrict": "Returns all index position where the element is found in the list (matches only the same types).", | |
"findStrict": "Returns all index positions where the element is found in the list (matches only the same types).", |
Moved BaseHelper methods in the right file
Added strict mode on list search functions/methods
Added Find and FindStrict methods to generic lists
Added RemoveNil and RemoveEmpty methods to generic lists
Added test to cover new functions
Simplified the test structure