Conversation
restorer.go
Outdated
There was a problem hiding this comment.
I kinda feel like the filtering should be up to the caller and not happen in restoreNodeTo. Feels like this is not this method's responsibility.
Why is that? |
|
not a fan of all this |
|
The limitation comes from using The Do you have a better idea? |
|
I've moved the filter selection to Any other thoughts? |
restorer.go
Outdated
There was a problem hiding this comment.
maybe it would be nicer to initialize res.SelectForRestore to func(...) { return true }, then you wouldn't have to do this kind of check... dunno if that's necessarily better. just an idea.
There was a problem hiding this comment.
Hm, I like that. I suppose this doesn't introduce any performance problems.
|
👍 Looks good. Tests would be A+. |
|
Test has been added, this can be merged. I'll rebase it to master and run travis again. |
Internally rename restorer.Filter -> restorer.SelectForRestore to make semantic clear. In addition, swap parameters to filepath.Match() so that the pattern can really be matched. Limitation: The filter only works on the filename, not on any path component, e.g. '*.go' selects all go files, 'subdir/foo*' doesn't select anything. Fixes #202.
Internally rename restorer.Filter -> restorer.SelectForRestore to make
semantic clear.
In addition, swap parameters to filepath.Match() so that the pattern can
really be matched.
Limitation: The filter only works on the filename, not on any path
component, e.g.
*.goselects all go files,subdir/foo*doesn'tselect anything.
This fixes #202.