From 8d28a816b405e21a7e192652d32bdf41d4059a72 Mon Sep 17 00:00:00 2001 From: yincong Date: Tue, 17 Dec 2024 17:43:21 +0800 Subject: [PATCH 1/3] update document --- src/net/http/request.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/net/http/request.go b/src/net/http/request.go index 686d53345aebd9..fc4b1ff8b73751 100644 --- a/src/net/http/request.go +++ b/src/net/http/request.go @@ -873,9 +873,9 @@ func NewRequest(method, url string, body io.Reader) (*Request, error) { // // NewRequestWithContext returns a Request suitable for use with // [Client.Do] or [Transport.RoundTrip]. To create a request for use with -// testing a Server Handler, either use the [NewRequest] function in the -// net/http/httptest package, use [ReadRequest], or manually update the -// Request fields. For an outgoing client request, the context +// testing a Server Handler, either use the [httptest.NewRequest] function +// use [ReadRequest], or manually update the Request fields. +// For an outgoing client request, the context // controls the entire lifetime of a request and its response: // obtaining a connection, sending the request, and reading the // response headers and body. See the Request type's documentation for From c56de4a2f261c01c220fc77b62564e7e35321d94 Mon Sep 17 00:00:00 2001 From: yincong Date: Tue, 24 Dec 2024 10:25:41 +0800 Subject: [PATCH 2/3] add comma --- src/net/http/request.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/http/request.go b/src/net/http/request.go index fc4b1ff8b73751..973c54dda5786b 100644 --- a/src/net/http/request.go +++ b/src/net/http/request.go @@ -873,7 +873,7 @@ func NewRequest(method, url string, body io.Reader) (*Request, error) { // // NewRequestWithContext returns a Request suitable for use with // [Client.Do] or [Transport.RoundTrip]. To create a request for use with -// testing a Server Handler, either use the [httptest.NewRequest] function +// testing a Server Handler, either use the [httptest.NewRequest] function, // use [ReadRequest], or manually update the Request fields. // For an outgoing client request, the context // controls the entire lifetime of a request and its response: From 05276c56b019d8774e8eee881101509cf83c0f3d Mon Sep 17 00:00:00 2001 From: yincong Date: Mon, 6 Jan 2025 10:05:15 +0800 Subject: [PATCH 3/3] optimize --- src/net/http/request.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/http/request.go b/src/net/http/request.go index 973c54dda5786b..434c1640f3941d 100644 --- a/src/net/http/request.go +++ b/src/net/http/request.go @@ -873,7 +873,7 @@ func NewRequest(method, url string, body io.Reader) (*Request, error) { // // NewRequestWithContext returns a Request suitable for use with // [Client.Do] or [Transport.RoundTrip]. To create a request for use with -// testing a Server Handler, either use the [httptest.NewRequest] function, +// testing a Server Handler, either use the [net/http/httptest.NewRequest] function, // use [ReadRequest], or manually update the Request fields. // For an outgoing client request, the context // controls the entire lifetime of a request and its response: