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
Feature/skip #19
Feature/skip #19
Conversation
@julplee This is my idea for your usecase. Let me know your thought. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that seems cleaner than my version!
If I want to send several files or directories to skip I have just to send several "skip" options to the options? Or should I send an array of strings to the skip option?
Now it's a function, you can define your own condition to check if it should be skipped or not. This is just an example by using opt := Options{
Skip: func(src string) bool {
return map[string]bool{
"foo.txt": true, // ← skip
"baa.txt": false, // NOT skipped
"baz.txt": true, // ← skip
// anything NOT specified will NOT be skipped
}[src]
},
}
Copy("dir_a", "dir_b", opt) The test cases I wrote uses |
OK perfect 👌 |
Thanks @julplee. |
Thank you very much! |
Close #18