BooleanCat / go-functional

go-functional is a library of iterators to augment the standard library
MIT License
452 stars 23 forks source link

Add iter.ForEach #53

Closed Rajan-226 closed 1 year ago

Rajan-226 commented 1 year ago

Please provide a brief description of the change.

A sentence or two is fine, the rest should be clear from the code change and related issue. It adds for each for iterator package, which can execute a callback on each item contained by an iterator.

Which issue does this change relate to?

Please provide a link to the issue that this change resolved.

45

If there is no such issue, consider creating one first. Discussions concerning proposed changes ought to take place in an issue and not in pull requests. Pull requests not associated with an issue are less likely to be merged and more likely to ask for changes.

Contribution checklist.

Replace the space in each box with "X" to check it off.

Additional context

Add any other context about the problem here.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (2141361) 100.00% compared to head (1aacaae) 100.00%. Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #53 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 19 19 Lines 376 382 +6 ========================================= + Hits 376 382 +6 ``` | [Files Changed](https://app.codecov.io/gh/BooleanCat/go-functional/pull/53?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tom+Godkin) | Coverage Δ | | |---|---|---| | [iter/iter.go](https://app.codecov.io/gh/BooleanCat/go-functional/pull/53?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tom+Godkin#diff-aXRlci9pdGVyLmdv) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Rajan-226 commented 1 year ago

@BooleanCat Have done the changes, I think find should also go in iter.go though.

BooleanCat commented 1 year ago

@BooleanCat Have done the changes, I think find should also go in iter.go though.

Good point and I agree. Feel free to submit a PR with this change otherwise I'll move it next time I'm near that code.

BooleanCat commented 1 year ago

@Rajan-226 Thanks for your contribution!