diff options
| author | Brad Fitzpatrick <bradfitz@tailscale.com> | 2021-05-12 13:12:41 -0700 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@tailscale.com> | 2021-05-12 13:12:41 -0700 |
| commit | 314d15b3fbdd3924cfd4f70f115fbac2c3070094 (patch) | |
| tree | d764c11439649e9702c4653aeff3ba94c232f0c0 | |
| parent | ed9d825552addde42b846d6e5bcd6eddaa19b7f0 (diff) | |
| download | tailscale-314d15b3fbdd3924cfd4f70f115fbac2c3070094.tar.xz tailscale-314d15b3fbdd3924cfd4f70f115fbac2c3070094.zip | |
version: add func IsRace to report whether race detector enabled
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
| -rw-r--r-- | version/race.go | 11 | ||||
| -rw-r--r-- | version/race_off.go | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/version/race.go b/version/race.go new file mode 100644 index 000000000..21972fa9a --- /dev/null +++ b/version/race.go @@ -0,0 +1,11 @@ +// Copyright (c) 2021 Tailscale Inc & AUTHORS All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build race + +package version + +// IsRace reports whether the current binary was built with the Go +// race detector enabled. +func IsRace() bool { return true } diff --git a/version/race_off.go b/version/race_off.go new file mode 100644 index 000000000..9876efc1b --- /dev/null +++ b/version/race_off.go @@ -0,0 +1,11 @@ +// Copyright (c) 2021 Tailscale Inc & AUTHORS All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !race + +package version + +// IsRace reports whether the current binary was built with the Go +// race detector enabled. +func IsRace() bool { return false } |
