1
0
mirror of https://github.com/golang/go synced 2024-09-25 09:20:18 -06:00

net/http: use internal/race

Change-Id: Iaa5ded13e8ab4753e2e3d04c9fff203d854208ba
Reviewed-on: https://go-review.googlesource.com/119435
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Tim Cooper 2018-06-18 12:48:30 -03:00 committed by Brad Fitzpatrick
parent bc276c585b
commit 3333b6407d
3 changed files with 2 additions and 14 deletions

View File

@ -14,8 +14,6 @@ import (
"time"
)
var raceEnabled = false // set by race.go
// A Header represents the key-value pairs in an HTTP header.
type Header map[string][]string

View File

@ -6,6 +6,7 @@ package http
import (
"bytes"
"internal/race"
"runtime"
"testing"
"time"
@ -196,7 +197,7 @@ func TestHeaderWriteSubsetAllocs(t *testing.T) {
if testing.Short() {
t.Skip("skipping alloc test in short mode")
}
if raceEnabled {
if race.Enabled {
t.Skip("skipping test under race detector")
}
if runtime.GOMAXPROCS(0) > 1 {

View File

@ -1,11 +0,0 @@
// Copyright 2014 The Go 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 http
func init() {
raceEnabled = true
}