Added "OS" interface to improve testability
Thanks to @twpayne, doublestar now has exported versions of PathMatch and Glob (PathMatchOS
and GlobOS
respectively) that take an OS
interface which can be used to abstract the underlying filesystem calls. Using something like go-vfs, you can then write unit tests for code that uses doublestar without depending on an actual filesystem.
Existing PathMatch and Glob are unchanged.