Skip to content

Commit c065ece

Browse files
committed
Use a local copy of client
1 parent 33e1129 commit c065ece

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

go/porcelain/http/http.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ func NewRetryableTransport(tr runtime.ClientTransport, attempts int) *RetryableT
3131
}
3232

3333
func (t *RetryableTransport) Submit(op *runtime.ClientOperation) (interface{}, error) {
34-
client := &http.Client{}
34+
var client http.Client
3535
if op.Client == nil {
36-
*client = *http.DefaultClient
36+
client = *http.DefaultClient
3737
} else {
38-
*client = *op.Client
38+
client = *op.Client
3939
}
4040

4141
transport := client.Transport
@@ -47,7 +47,7 @@ func (t *RetryableTransport) Submit(op *runtime.ClientOperation) (interface{}, e
4747
attempts: t.attempts,
4848
}
4949

50-
op.Client = client
50+
op.Client = &client
5151
res, err := t.tr.Submit(op)
5252

5353
return res, err

0 commit comments

Comments
 (0)