Sources in pkg/examples/examples.go walks the filesystem with filepath.Walk and checks each path against defaultSkip fragments (/out/, .out., /.git) using a plain strings.Contains. On Windows, filepath.Walk returns backslash-separated paths (examples\nz\out\invoice.json), so the forward-slash fragments never match and generated output files in out/ are included in the discovered sources instead of being skipped.
This causes TestConvertExamplesToJSON to fail on Windows: it tries to convert already-generated JSON snapshots as if they were source examples.
Fix: normalize the path with filepath.ToSlash before the strings.Contains check, so skip-list matching is platform-independent.
Fixed by PR #867
Sources in
pkg/examples/examples.gowalks the filesystem withfilepath.Walkand checks each path againstdefaultSkipfragments (/out/,.out.,/.git) using a plainstrings.Contains. On Windows,filepath.Walkreturns backslash-separated paths (examples\nz\out\invoice.json), so the forward-slash fragments never match and generated output files inout/are included in the discovered sources instead of being skipped.This causes
TestConvertExamplesToJSONto fail on Windows: it tries to convert already-generated JSON snapshots as if they were source examples.Fix: normalize the path with
filepath.ToSlashbefore thestrings.Containscheck, so skip-list matching is platform-independent.Fixed by PR #867