]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: remove redundant code
authortk <tk103331@gmail.com>
Fri, 9 Sep 2022 03:02:56 +0000 (03:02 +0000)
committerDamien Neil <dneil@google.com>
Tue, 8 Nov 2022 03:06:55 +0000 (03:06 +0000)
Remove redundant code at line 365, `oldCtx := req.Context()`,  because it's the same as line 349.

Change-Id: I9b028e8c8740c22945708b143e4e86a0baa40f64
GitHub-Last-Rev: 4ad0f3871b1d473246af7cf27c158140c7248cf1
GitHub-Pull-Request: golang/go#54925
Reviewed-on: https://go-review.googlesource.com/c/go/+/428977
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Damien Neil <dneil@google.com>

src/net/http/client.go

index f57417ea10ff7a9da52836530e8924d40734fcd6..617446b030794aeb736296c2d7189cf4b3fa0e01 100644 (file)
@@ -362,7 +362,7 @@ func setRequestCancel(req *Request, rt RoundTripper, deadline time.Time) (stopTi
        initialReqCancel := req.Cancel // the user's original Request.Cancel, if any
 
        var cancelCtx func()
-       if oldCtx := req.Context(); timeBeforeContextDeadline(deadline, oldCtx) {
+       if timeBeforeContextDeadline(deadline, oldCtx) {
                req.ctx, cancelCtx = context.WithDeadline(oldCtx, deadline)
        }