Lines Matching full:race
2 "Title": "Data Race Detector",
10 A data race occurs when two goroutines access the same variable concurrently and at least one of the accesses is a write.
15 Here is an example of a data race that can lead to crashes and memory corruption:
37 To help diagnose such bugs, Go includes a built-in data race detector.
38 To use it, add the <code>-race</code> flag to the go command:
42 $ go test -race mypkg // to test the package
43 $ go run -race mysrc.go // to run the source file
44 $ go build -race mycmd // to build the command
45 $ go install -race mypkg // to install the package
51 When the race detector finds a data race in the program, it prints a report.
57 WARNING: DATA RACE
94 The <code>GORACE</code> environment variable sets race detector options.
108 <code>log_path</code> (default <code>stderr</code>): The race detector writes
117 exiting after a detected race.
134 exits after reporting first data race.
143 $ GORACE="log_path=/tmp/race/report strip_path_prefix=/my/go/sources/" go test -race
149 When you build with <code>-race</code> flag, the <code>go</code> command defines additional
150 <a href="/pkg/go/build/#hdr-Build_Constraints">build tag</a> <code>race</code>.
151 You can use the tag to exclude some code and tests when running the race detector.
156 // +build !race
160 // The test contains a data race. See issue 123.
165 // The test fails under the race detector due to timeouts.
170 // The test takes too long under the race detector.
179 To start, run your tests using the race detector (<code>go test -race</code>).
180 The race detector only finds races that happen at runtime, so it can't find
183 you may find more races by running a binary built with <code>-race</code> under a realistic
190 Here are some typical data races. All of them can be detected with the race detector.
193 <h3 id="Race_on_loop_counter">Race on loop counter</h3>
352 A typical fix for this race is to use a channel or a mutex.
380 The race detector runs on <code>darwin/amd64</code>, <code>freebsd/amd64</code>,
387 The cost of race detection varies by program, but for a typical program, memory