Skip to content

testing: skip flag not applied to examples #61482

@pascaldekloe

Description

@pascaldekloe

What version of Go are you using (go version)?

$ go version
go version devel go1.21-9cf97cbbdd Fri Jul 14 16:37:04 2023 +0200 darwin/arm64

Does this issue reproduce with the latest release?

Yes

What did you do?

Run go test -v strings -skip Trim.

What did you expect to see?

Regular expression "Trim" should skip ExampleTrim.

-skip regexp
    Run only those tests, examples, fuzz tests, and benchmarks that
    do not match the regular expression.

What did you see instead?

Go runs ExampleTrim anyway.

=== RUN   ExampleTrim
--- PASS: ExampleTrim (0.00s)

It does skip TestTrim though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions