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

main
Brad Fitzpatrick 5 years ago
parent fc8bc76e58
commit ff50ddf1ee
  1. 9
      util/racebuild/off.go
  2. 9
      util/racebuild/on.go
  3. 7
      util/racebuild/racebuild.go

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

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

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