diff options
| author | Weixie Cui <cuiweixie@gmail.com> | 2026-04-05 05:54:44 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2026-04-14 07:13:38 -0700 |
| commit | 136332571bcc552b9cc3ff8ac44aeb370425e7d7 (patch) | |
| tree | f642c1dd3c40097eaefa98bfc2832a379ca70743 /src/net/dial.go | |
| parent | 78314e01407678a19b30bc11aba450808686155f (diff) | |
| download | go-136332571bcc552b9cc3ff8ac44aeb370425e7d7.tar.xz | |
net: cancel2 should not be shadow
Fixes #78531
Change-Id: I7ccd84f9a3ced75c86b7540d84309e094717ffba
GitHub-Last-Rev: 03a8ee1fd132a597e1a1e30add7cf7ba00ac114a
GitHub-Pull-Request: golang/go#78532
Reviewed-on: https://go-review.googlesource.com/c/go/+/762780
Auto-Submit: Nicholas Husin <husin@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
Diffstat (limited to 'src/net/dial.go')
| -rw-r--r-- | src/net/dial.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/net/dial.go b/src/net/dial.go index a87c57603a..10c0068449 100644 --- a/src/net/dial.go +++ b/src/net/dial.go @@ -572,7 +572,8 @@ func (d *Dialer) dialCtx(ctx context.Context) (context.Context, context.CancelFu } } if oldCancel := d.Cancel; oldCancel != nil { - subCtx, cancel2 := context.WithCancel(ctx) + var subCtx context.Context + subCtx, cancel2 = context.WithCancel(ctx) go func() { select { case <-oldCancel: |
