Skip to content

Releases: bmatcuk/doublestar

Fixed FilepathGlob("")

11 Oct 13:53
v4.7.1
1e20c6d
Compare
Choose a tag to compare

To be consistent with filepath.Glob, FilepathGlob("") returns nil.

Added MatchUnvalidated, PathMatchUnvalidated

11 Oct 13:07
v4.7.0
2832f67
Compare
Choose a tag to compare

These functions provide a small performance improvement in cases where you don't care about whether or not the pattern is valid (maybe because you already ran ValidatePattern).

Fixed Match bug with patterns like `a/**/`

21 Oct 15:00
v4.6.1
180028b
Compare
Choose a tag to compare

Thanks @mmxmb for submitting the bug and opening a PR in #89!

Added WithNoFollow

05 Jan 16:01
v4.6.0
465a339
Compare
Choose a tag to compare

Added a WithNoFollow option for Glob, GlobWalk, and FilepathGlob that will cause doublestar to not follow symlinks. However, note that there is a caveat due to io/fs limitations: if the pattern mentions a symlink before any meta characters, those symlinks will be followed. For example: path/to/symlink/* will follow the symlink, assuming it is valid and links to a directory. path/** and path/*/symlink/* will not follow the symlink.

Added WithFilesOnly

04 Jan 17:58
v4.5.0
3c85a19
Compare
Choose a tag to compare

Added a new option for Glob, GlobWalk, and FilepathGlob called WithFilesOnly that will cause these functions to only return files. For example, a pattern such as folder/* will only return the files inside the folder, and not any directories. Note that symlinks to directories are considered directories for this purpose.

Added WithFailOnPatternNotExist

07 Nov 14:12
v4.4.0
65c0f86
Compare
Choose a tag to compare

Added the option WithFailOnPatternNotExist to Glob, GlobWalk, and FilepathGlob. This option will cause doublestar to abort if the pattern references a path that does not exist, for example, nonexistent/path/*.

Fixed Glob Bug With Pattern That Has Nonexistent Path And WithFailOnIOErrors

05 Nov 14:08
v4.3.1
315bbcf
Compare
Choose a tag to compare

If the WithFailOnIOErrors option was set and the pattern contained a reference to a nonexistent path (such as nonexistent/path/*), Glob would return ErrNotExist. It now returns an empty result with no error as expected.

For anyone that would prefer that doublestar returned an error, I'll be adding that as a feature (and a separate option) later.

Added Support for GlobOptions

31 Oct 00:40
v4.3.0
066043f
Compare
Choose a tag to compare

This release adds options to Glob, GlobWalk, and FilepathGlob. At the moment, the only option is WithFailOnIOErrors that will cause doublestar to fail and return an error if it encounters any IO errors. It can be used like:

doublestar.Glob(fsys, pattern, WithFailOnIOErrors())

Thanks @fho!

Added Support for SkipDir to GlobWalk

10 Jul 18:28
v4.2.0
cfa46a9
Compare
Choose a tag to compare

Your callback to GlobWalk can now return SkipDir which functions as it does in the standard library: if the current path is a directory, GlobWalk will not recurse into it. If the current path is not a directory, GlobWalk will stop processing the parent directory.

Added FilepathGlob Convenience Func; Better Support for Escaped Meta Chars

09 Jul 23:16
v4.1.0
884dbbe
Compare
Choose a tag to compare

FilepathGlob is a convenience function for people who want a drop-in replacement for filepath.Glob().

Thanks sebastien-rosset