Skip to content

pkg/examples: skip-list matching silently fails on Windows #868

Description

@pedrorfdez

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions