-
Notifications
You must be signed in to change notification settings - Fork 105
Open
Description
Hey @peterbourgon - loving this library and thank you for your stewardship!
Would love to have you take a look at the following lines:
Lines 597 to 601 in 2566386
| key := d.InverseTransform(pathKey) | |
| if info.IsDir() || !strings.HasPrefix(key, prefix) { | |
| return nil // "pass" | |
| } |
By my reading, it would be preferable not to call InverseTransform for directories. In my case, I'm using the AdvancedTransform and its inverse in the README, and this is tickling the "panic" line because directories do not carry the expected extension.
What about switching the logic to this? In other words, pass on the directory BEFORE calling InverseTransform.
if info.IsDir() {
return nil // "pass"
}
key := d.InverseTransform(pathKey)
if !strings.HasPrefix(key, prefix) {
return nil // "pass"
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels