util/racebuild: add package to export a race-is-enabled const

This commit is contained in:
Brad Fitzpatrick 2020-11-16 10:11:53 -08:00
parent fc8bc76e58
commit ff50ddf1ee
3 changed files with 25 additions and 0 deletions

9
util/racebuild/off.go Normal file
View File

@ -0,0 +1,9 @@
// Copyright (c) 2020 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 racebuild
const On = false

9
util/racebuild/on.go Normal file
View File

@ -0,0 +1,9 @@
// Copyright (c) 2020 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 racebuild
const On = true

View File

@ -0,0 +1,7 @@
// Copyright (c) 2020 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.
// Package racebuild exports a constant about whether the current binary
// was built with the race detector.
package racebuild