Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add fileinfo to skip function #40

Closed
wants to merge 1 commit into from

Conversation

tongjingran
Copy link

@tongjingran tongjingran commented Dec 23, 2020

FileInfo is needed to determine whether the file needs to be skipped in many cases.

@otiai10 otiai10 self-requested a review December 23, 2020 23:19
@otiai10 otiai10 self-assigned this Dec 23, 2020
@tongjingran
Copy link
Author

tongjingran commented Dec 29, 2020

The Skip function looks like a callback function to judge the file should skip or not.
In golang project, package path/filepath has a similar type WalkFunc.
type WalkFunc func(path string, info os.FileInfo, err error) error
In most situaitions, simply providing the file name is not enough. Use an extra os.Stat operation is a waste of performance.

@otiai10
Copy link
Owner

otiai10 commented Dec 29, 2020

You are right. It's gonna be v2 then with more refactoring because it's change of interface of this package

@otiai10 otiai10 mentioned this pull request Mar 3, 2021
otiai10 added a commit that referenced this pull request Oct 26, 2022
otiai10 added a commit that referenced this pull request Nov 9, 2022
@otiai10 otiai10 closed this in #92 Nov 9, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants