Skip to content

runtime: provide a way to obtain build tags #7007

@dvyukov

Description

@dvyukov
The problem at hand is to determine when you are running under race detector. This is
frequently needed to disable tests, reduce number of iterations or scale timeouts.
See e.g.:
https://golang.org/cl/44180043/diff/60001/src/pkg/runtime/pprof/pprof_test.go
where we have to completely disable the test, while we want to do it only under race
detector.

David noted that this is a more general problem, and proposed to extend it to all build
tags, e.g.:
if runtime.Tag("race") { ... }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions