Skip to content
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

Merged
merged 8 commits into from
Jul 21, 2020

Conversation

jocgir
Copy link
Contributor

@jocgir jocgir commented Jul 21, 2020

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

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
@jocgir jocgir requested review from julienduchesne, ycanty and a team July 21, 2020 13:27
@jocgir
Copy link
Contributor Author

jocgir commented Jul 21, 2020

This looks as a big change, but in fact, a lot of this code is automatically generated by gogenerate.

@jocgir jocgir changed the title Moved BaseHelper methods in the right file Added Find and FindStrict methods to generic lists Jul 21, 2020
Copy link
Contributor

@dblanchette dblanchette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great test coverage :)

collections/implementation/generic_test.go Outdated Show resolved Hide resolved
collections/implementation/generic_test.go Outdated Show resolved Hide resolved
template/extra_data.go Outdated Show resolved Hide resolved
template/extra_data.go Outdated Show resolved Hide resolved
jocgir and others added 5 commits July 21, 2020 10:36
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>
@jocgir jocgir merged commit 3e68238 into master Jul 21, 2020
@jocgir jocgir deleted the features/add-find-method-to-list branch July 21, 2020 14:41
@@ -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.",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"removeEmpty": "Returns a list will all empty element removed.",
"removeEmpty": "Returns a list with all empty elements removed.",

@@ -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.",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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).",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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).",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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).",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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).",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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).",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants