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 4
4
// Copyright (c) Microsoft Corporation. All rights reserved.
5
5
// Licensed under the MIT License.
6
6
7
- package runtime
7
+ package runtime_test
8
8
9
9
import (
10
10
"context"
11
11
"net/http"
12
+
13
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
12
14
)
13
15
14
16
func ExampleWithCaptureResponse () {
15
17
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
17
25
}
You can’t perform that action at this time.
0 commit comments