Skip to content

testing: document that TestMain always runs before any benchmarks #45764

@ghost

Description

The docs for TestMain say:

It is sometimes necessary for a test program to do extra setup
or teardown before or after testing.

https://golang.org/pkg/testing/#hdr-Main

But what if one needs to do extra setup before benchmarking? It appears that TestMain would also always run before benchmarks, but neither TestMain doc nor M.Run doc say anything about benchmarks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.help wanted

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions