You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

thebigman.ddns.net/ipfs/go-detect-race

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

thebigman.ddns.net/ipfs/go-detect-race

v0.0.1
Go
Version published
Created
Source

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 :)

FAQs

Package last updated on 28 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts