version: add func IsRace to report whether race detector enabled

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
apenwarr/fixes
Brad Fitzpatrick 3 years ago
parent ed9d825552
commit 314d15b3fb

@ -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 }

@ -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 }
Loading…
Cancel
Save