From e99b53d3e3a23771362e879def36e898105aa6e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Jan 2026 03:46:23 +0000 Subject: [PATCH] chore(deps): bump github.com/bmatcuk/doublestar/v4 from 4.9.1 to 4.9.2 Bumps [github.com/bmatcuk/doublestar/v4](https://github.com/bmatcuk/doublestar) from 4.9.1 to 4.9.2. - [Release notes](https://github.com/bmatcuk/doublestar/releases) - [Commits](https://github.com/bmatcuk/doublestar/compare/v4.9.1...v4.9.2) --- updated-dependencies: - dependency-name: github.com/bmatcuk/doublestar/v4 dependency-version: 4.9.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 +-- .../bmatcuk/doublestar/v4/README.md | 32 +++++++++++++++++++ .../github.com/bmatcuk/doublestar/v4/glob.go | 2 +- .../bmatcuk/doublestar/v4/globwalk.go | 2 +- .../github.com/bmatcuk/doublestar/v4/utils.go | 11 +++++-- vendor/modules.txt | 2 +- 7 files changed, 47 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 207e5b7f3..6d35a95ce 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.24.0 toolchain go1.24.1 require ( - github.com/bmatcuk/doublestar/v4 v4.9.1 + github.com/bmatcuk/doublestar/v4 v4.9.2 github.com/go-git/go-git/v5 v5.16.3 github.com/hashicorp/go-retryablehttp v0.7.8 github.com/iancoleman/strcase v0.3.0 diff --git a/go.sum b/go.sum index 3e1dcbd46..631ba2cb1 100644 --- a/go.sum +++ b/go.sum @@ -44,8 +44,8 @@ github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFI github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/bmatcuk/doublestar/v4 v4.9.1 h1:X8jg9rRZmJd4yRy7ZeNDRnM+T3ZfHv15JiBJ/avrEXE= -github.com/bmatcuk/doublestar/v4 v4.9.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/bmatcuk/doublestar/v4 v4.9.2 h1:b0mc6WyRSYLjzofB2v/0cuDUZ+MqoGyH3r0dVij35GI= +github.com/bmatcuk/doublestar/v4 v4.9.2/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= diff --git a/vendor/github.com/bmatcuk/doublestar/v4/README.md b/vendor/github.com/bmatcuk/doublestar/v4/README.md index e4d1941e3..2476b413c 100644 --- a/vendor/github.com/bmatcuk/doublestar/v4/README.md +++ b/vendor/github.com/bmatcuk/doublestar/v4/README.md @@ -391,6 +391,38 @@ Class | Meaning `[^class]` | matches any single character which does *not* match the class `[!class]` | same as `^`: negates the class +#### Globs Are Not Regular Expressions + +Occasionally I get bug reports that some regular-expression-style syntax +doesn't work, or feature requests to add some regular-expression-inspired +syntax. Globs are not regular expressions. However, if globs are not +sufficiently expressive for your filtering needs, I recommend a two stage +approach using `GlobWalk`. Something like the following will get you started: + +```go +var matches []string +err := doublestar.GlobWalk(fsys, pattern, func(p string, d fs.DirEntry) error { + if (customFilter(p, d)) { + matches = append(matches, p) + } else if (d.isDir()) { + return doublestar.SkipDir + } + return nil +}) +return matches, err +``` + +In this example, `pattern` should be a glob that does a first pass at fetching +the files you might be interested in; `customFilter` is a function that does a +second pass. This second pass could be anything, including regular expressions. +Try to fashion a `pattern` that reduces the number of files you need to +consider in your second pass `customFilter`. + +One final note: empty alternatives can be used to build some more complicated +globs. For example, `some{thing,}` will match both "something" and "some". +Alternatives can also be nested, like `some{thing{new,},}`, which would match +"somethingnew", "something", and "some". + ## Performance ``` diff --git a/vendor/github.com/bmatcuk/doublestar/v4/glob.go b/vendor/github.com/bmatcuk/doublestar/v4/glob.go index 3471bea78..defe8e264 100644 --- a/vendor/github.com/bmatcuk/doublestar/v4/glob.go +++ b/vendor/github.com/bmatcuk/doublestar/v4/glob.go @@ -158,7 +158,7 @@ func (g *glob) globAlts(fsys fs.FS, pattern string, openingIdx, closingIdx int, nextIdx += patIdx } - alt := buildAlt(d, pattern, startIdx, openingIdx, patIdx, nextIdx, afterIdx) + alt := buildAlt(escapeMeta(d), pattern, startIdx, openingIdx, patIdx, nextIdx, afterIdx) matches, err = g.doGlob(fsys, alt, matches, firstSegment, beforeMeta) if err != nil { return diff --git a/vendor/github.com/bmatcuk/doublestar/v4/globwalk.go b/vendor/github.com/bmatcuk/doublestar/v4/globwalk.go index 16601b76a..4c66018c2 100644 --- a/vendor/github.com/bmatcuk/doublestar/v4/globwalk.go +++ b/vendor/github.com/bmatcuk/doublestar/v4/globwalk.go @@ -205,7 +205,7 @@ func (g *glob) doGlobAltsWalk(fsys fs.FS, d, pattern string, startIdx, openingId nextIdx += patIdx } - alt := buildAlt(d, pattern, startIdx, openingIdx, patIdx, nextIdx, afterIdx) + alt := buildAlt(escapeMeta(d), pattern, startIdx, openingIdx, patIdx, nextIdx, afterIdx) err = g.doGlobWalk(fsys, alt, firstSegment, beforeMeta, func(p string, d fs.DirEntry) error { // insertion sort, ignoring dups insertIdx := matchesLen diff --git a/vendor/github.com/bmatcuk/doublestar/v4/utils.go b/vendor/github.com/bmatcuk/doublestar/v4/utils.go index 7831e5c3d..7f5cda751 100644 --- a/vendor/github.com/bmatcuk/doublestar/v4/utils.go +++ b/vendor/github.com/bmatcuk/doublestar/v4/utils.go @@ -152,9 +152,16 @@ func indexNextAlt(s string, allowEscaping bool) int { return -1 } -var metaReplacer = strings.NewReplacer("\\*", "*", "\\?", "?", "\\[", "[", "\\]", "]", "\\{", "{", "\\}", "}") +var escapeMetaReplacer = strings.NewReplacer("*", "\\*", "?", "\\?", "[", "\\[", "]", "\\]", "{", "\\{", "}", "\\}") + +// Escapes meta characters (*?[]{}) +func escapeMeta(path string) string { + return escapeMetaReplacer.Replace(path) +} + +var unescapeMetaReplacer = strings.NewReplacer("\\*", "*", "\\?", "?", "\\[", "[", "\\]", "]", "\\{", "{", "\\}", "}") // Unescapes meta characters (*?[]{}) func unescapeMeta(pattern string) string { - return metaReplacer.Replace(pattern) + return unescapeMetaReplacer.Replace(pattern) } diff --git a/vendor/modules.txt b/vendor/modules.txt index ae7ddd8e6..922296810 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -32,7 +32,7 @@ github.com/ProtonMail/go-crypto/openpgp/packet github.com/ProtonMail/go-crypto/openpgp/s2k github.com/ProtonMail/go-crypto/openpgp/x25519 github.com/ProtonMail/go-crypto/openpgp/x448 -# github.com/bmatcuk/doublestar/v4 v4.9.1 +# github.com/bmatcuk/doublestar/v4 v4.9.2 ## explicit; go 1.16 github.com/bmatcuk/doublestar/v4 # github.com/clipperhouse/displaywidth v0.3.1