File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 44// Copyright (c) Microsoft Corporation. All rights reserved.
55// Licensed under the MIT License.
66
7- package runtime
7+ package runtime_test
88
99import (
1010 "context"
1111 "net/http"
12+
13+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
1214)
1315
1416func ExampleWithCaptureResponse () {
1517 var respFromCtx * http.Response
16- WithCaptureResponse (context .Background (), & respFromCtx )
18+ ctx := context .TODO ()
19+ ctx = runtime .WithCaptureResponse (ctx , & respFromCtx )
20+ // make some client method call using the updated context
21+ // resp, err := client.SomeMethod(ctx, ...)
22+ // *respFromCtx contains the raw *http.Response returned during the client method call.
23+ // if the HTTP transport didn't return a response due to an error then *respFromCtx will be nil.
24+ _ = ctx
1725}
You can’t perform that action at this time.
0 commit comments