mirror of
https://github.com/golang/go
synced 2024-11-12 09:20:22 -07: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:
parent
bc276c585b
commit
3333b6407d
@ -14,8 +14,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
var raceEnabled = false // set by race.go
|
|
||||||
|
|
||||||
// A Header represents the key-value pairs in an HTTP header.
|
// A Header represents the key-value pairs in an HTTP header.
|
||||||
type Header map[string][]string
|
type Header map[string][]string
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ package http
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"internal/race"
|
||||||
"runtime"
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@ -196,7 +197,7 @@ func TestHeaderWriteSubsetAllocs(t *testing.T) {
|
|||||||
if testing.Short() {
|
if testing.Short() {
|
||||||
t.Skip("skipping alloc test in short mode")
|
t.Skip("skipping alloc test in short mode")
|
||||||
}
|
}
|
||||||
if raceEnabled {
|
if race.Enabled {
|
||||||
t.Skip("skipping test under race detector")
|
t.Skip("skipping test under race detector")
|
||||||
}
|
}
|
||||||
if runtime.GOMAXPROCS(0) > 1 {
|
if runtime.GOMAXPROCS(0) > 1 {
|
||||||
|
@ -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
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user