From 14cd7160683ff3404e9f3fecf2369b874b1b74b3 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 5 May 2024 19:38:30 -0700 Subject: [PATCH] Fix depth filter on Windows --- filters/depth/depth.go | 2 +- test.bat | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 test.bat diff --git a/filters/depth/depth.go b/filters/depth/depth.go index 2d16b6f..76a5fd0 100644 --- a/filters/depth/depth.go +++ b/filters/depth/depth.go @@ -24,7 +24,7 @@ func (self *Depth) Accept(file *goldsmith.File) bool { return true } - if parts := strings.Split(file.Path(), string(filepath.Separator)); len(parts) <= self.depth { + if parts := strings.Split(filepath.FromSlash(file.Path()), string(filepath.Separator)); len(parts) <= self.depth { return true } diff --git a/test.bat b/test.bat new file mode 100644 index 0000000..6ea66d1 --- /dev/null +++ b/test.bat @@ -0,0 +1,2 @@ +@echo off +go test ./filters/... ./plugins/...