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

Add iter.ForEach #53

Merged
merged 1 commit into from
Aug 15, 2023
Merged

Add iter.ForEach #53

merged 1 commit into from
Aug 15, 2023

Conversation

Rajan-226
Copy link
Contributor

@Rajan-226 Rajan-226 commented Aug 15, 2023

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.

  • I have read and understood the CONTRIBUTING guidelines
  • My code is formatted (make check)
  • I have run tests (make test)
  • All commits in my PR conform to the commit hygiene section
  • I have added relevant tests
  • I have not added any dependencies

Additional context

Add any other context about the problem here.

Copy link
Owner

@BooleanCat BooleanCat left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! It looks good and I have a few requests in line and here:

  1. Please move the implementation into iter.go
  2. Please move the tests into iter_test.go

A note on the file name you've chosen, in Go the convention is to use snake_case_test.go.

I'll run the tests for you now in case I missed anything.

iter/forEach.go Outdated Show resolved Hide resolved
iter/forEach_test.go Outdated Show resolved Hide resolved
iter/forEach_test.go Outdated Show resolved Hide resolved
@BooleanCat BooleanCat linked an issue Aug 15, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Aug 15, 2023

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
@@            Coverage Diff            @@
##              main       #53   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        19           
  Lines          376       382    +6     
=========================================
+ Hits           376       382    +6     
Files Changed Coverage Δ
iter/iter.go 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Rajan-226
Copy link
Contributor Author

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

@BooleanCat
Copy link
Owner

@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 BooleanCat merged commit 291888d into BooleanCat:main Aug 15, 2023
9 checks passed
@BooleanCat
Copy link
Owner

@Rajan-226 Thanks for your contribution!

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.

[Feature 🔨]: Support callback operations over iterators (ForEach)
2 participants