Skip to content

proposal: testing: delay registration of flags until MainStart; add Init for explicit registration #21051

Description

@rsc

Mitchell Hashimoto pointed out at Gophercon that if you write
packages that provides extra test hooks mentioning *testing.T,
the import of "testing" forces the testing flags into any resulting
binary, even non-test binaries. At Hashicorp they define a separate
package that defines a copied testing.T interface only to avoid
these flag definitions.

I sent CL 49251 to delay the registration of the flags so that
those packages can import "testing" directly instead of a fake
package that must be kept in sync.

For discussion for Go 1.10.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions