-
Notifications
You must be signed in to change notification settings - Fork 18k
proposal: io/fs: add fs.Files()
iterator
#68983
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
Comments
Related Issues and Documentation (Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
Why is the function declaration not |
I think this would be better handled as part of the discussion on #64341, rather than splitting the discussion of iterators over file systems into two separate proposals. |
fs.All()
iteratorfs.Files()
iterator
I went back and forth on this for a bit, but applied this suggestion in the end. Note that because errors are automatically collected by the iterator, the
The design goals seemed to differ enough to me - #64341 attempts to preserve all of the functionality of Notably, this would have been proposed as |
Let me put it this way: we are only going to implement one iterator over the files in an |
Closing in favor of #64341 |
Proposal Details
A previous proposal for walking through directory trees can be found here:
This proposal aims for a simpler interface, making a deliberate decision to focus on the use case of reading file contents.
Signature
Usage
The text was updated successfully, but these errors were encountered: