Skip to content

Commit b6b4004

Browse files
committed
net: context plumbing, add Dialer.DialContext
For #12580 (http.Transport tracing/analytics) Updates #13021 Change-Id: I126e494a7bd872e42c388ecb58499ecbf0f014cc Reviewed-on: https://go-review.googlesource.com/22101 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Mikio Hara <[email protected]>
1 parent 1d0977a commit b6b4004

33 files changed

+517
-377
lines changed

src/go/build/deps_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@ var pkgDeps = map[string][]string{
280280
// Basic networking.
281281
// Because net must be used by any package that wants to
282282
// do networking portably, it must have a small dependency set: just L0+basic os.
283-
"net": {"L0", "CGO", "math/rand", "os", "sort", "syscall", "time", "internal/syscall/windows", "internal/singleflight", "internal/race"},
283+
"net": {"L0", "CGO",
284+
"context", "math/rand", "os", "sort", "syscall", "time",
285+
"internal/syscall/windows", "internal/singleflight", "internal/race"},
284286

285287
// NET enables use of basic network-related packages.
286288
"NET": {

src/net/cgo_unix_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77

88
package net
99

10-
import "testing"
10+
import (
11+
"context"
12+
"testing"
13+
)
1114

1215
func TestCgoLookupIP(t *testing.T) {
1316
host := "localhost"
@@ -18,7 +21,7 @@ func TestCgoLookupIP(t *testing.T) {
1821
if err != nil {
1922
t.Error(err)
2023
}
21-
if _, err := goLookupIP(host); err != nil {
24+
if _, err := goLookupIP(context.Background(), host); err != nil {
2225
t.Error(err)
2326
}
2427
}

0 commit comments

Comments
 (0)