Hey @peterbourgon - loving this library and thank you for your stewardship!
Would love to have you take a look at the following lines:
|
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"
}
Hey @peterbourgon - loving this library and thank you for your stewardship!
Would love to have you take a look at the following lines:
diskv/diskv.go
Lines 597 to 601 in 2566386
By my reading, it would be preferable not to call
InverseTransformfor directories. In my case, I'm using theAdvancedTransformand 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.