detectrace

package
v0.4.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2017 License: MIT, MIT Imports: 0 Imported by: 0

README

go-detect-race

Check if the race detector is running.

I didnt find a variable to check quickly enough so I made this.

Usage

import (
  detectrace "github.com/jbenet/go-detect-race"
)

func main() {
  if detectrace.WithRace() {
    // running with -race
  } else {
    // running without -race
  }
}

Why?

Because the race detector doesnt like massive stress tests. Example: https://groups.google.com/forum/#!topic/golang-nuts/XDPHUt2LE70

Why didn't you just use...

Please tell me about a better way of doing this. It wasn't readily apparent to me, so I made this. But i would much prefer an env var or some already existing var from the stdlib :)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithRace

func WithRace() bool

WithRace returns whether the binary was compiled with the race flag on.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL