Skip to content

proposal: testing: Export Name of Test or Benchmark #17231

@sgerhardt

Description

@sgerhardt

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

1.7

What operating system and processor architecture are you using (go env)?

windows/amd64

What did you do?

Can't get a test name without using reflection or hard-coding name.
Test name is not exported https://github.com/golang/go/blob/master/src/testing/testing.go#L269.

What did you expect to see?

The test name exported.
e.g.

func TestSomething(t *testing.T) {
    t.Log(t.Name())
...
}

What did you see instead?

Non-exported test name.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions