Skip to content

Commit 4ae54d6

Browse files
klaidliadonVojtechVitek
authored andcommitted
add context
1 parent 3f1f017 commit 4ae54d6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

_examples/golang-basics/example.gen.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_examples/golang-imports/api.gen.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client.go.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func urlBase(addr string) string {
201201

202202
// newRequest makes an http.Request from a client, adding common headers.
203203
func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType string) (*http.Request, error) {
204-
req, err := http.NewRequest("POST", url, reqBody)
204+
req, err := http.NewRequestWithContext(ctx, "POST", url, reqBody)
205205
if err != nil {
206206
return nil, err
207207
}
@@ -295,4 +295,4 @@ func HTTPRequestHeaders(ctx context.Context) (http.Header, bool) {
295295
}
296296

297297
{{- end -}}
298-
{{- end -}}
298+
{{- end -}}

0 commit comments

Comments
 (0)