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

Ensure that Filter methods return empty slice when nothing matches #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chrispappas
Copy link
Contributor

@chrispappas chrispappas commented Aug 31, 2022

  • previously if the filter matched nothing, []T(nil) would be returned, rather than an actual empty slice []T{}
  • this is because we weren't initializing the out return value, so if nothing matched the filter, it would just return the default value of nil
  • add Example and "No Matches" tests

* previously if the filter matched nothing, []T(nil) would be returned, rather than an actual empty slice []T{}
* add Example and "No Matches" tests
@chrispappas chrispappas changed the title Ensure that the out return param is initialized Ensure that the out return param is initialized in Filter methods Aug 31, 2022
@chrispappas chrispappas changed the title Ensure that the out return param is initialized in Filter methods Ensure that Filter methods return empty slice when nothing matches Sep 1, 2022
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.

1 participant