From: Nicolas Peugnet Date: Sat, 25 Jan 2025 16:43:28 +0100 Subject: Allow compiling with doublestar/v4 This is the version that is currently in Debian. In this version, the pattern "\\" returns a parsing error, so one test case has to be updated. --- filesystem/filesystem.go | 2 +- filesystem/filesystem_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index 26fdb36..02aca2f 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -124,7 +124,7 @@ func MakeFileSetFunc(baseDir string) function.Function { // automatically cleaned during this operation. pattern = filepath.Join(path, pattern) - matches, err := doublestar.Glob(pattern) + matches, err := doublestar.FilepathGlob(pattern) if err != nil { return cty.UnknownVal(cty.Set(cty.String)), fmt.Errorf("failed to glob pattern (%s): %s", pattern, err) } diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go index ae7bd61..d600e2b 100644 --- a/filesystem/filesystem_test.go +++ b/filesystem/filesystem_test.go @@ -260,7 +260,7 @@ func TestFileSet(t *testing.T) { cty.StringVal("."), cty.StringVal("\\"), cty.SetValEmpty(cty.String), - false, + true, }, }..., )