Skip to content

Commit c381ba8

Browse files
ivyodeke-em
authored andcommitted
net/http: fix minor typos in Request godoc
Fixes missing commas where it wasn't immediately apparent whether "requests" was being used as a verb or a noun. Change-Id: Ic8c99b4f46475f40a6160d26a3cd11c215940dd5 GitHub-Last-Rev: 1becf6f GitHub-Pull-Request: #27649 Reviewed-on: https://go-review.googlesource.com/135135 Reviewed-by: Emmanuel Odeke <[email protected]>
1 parent 0a87205 commit c381ba8

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/net/http/request.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ var reqWriteExcludeHeader = map[string]bool{
105105
// documentation for Request.Write and RoundTripper.
106106
type Request struct {
107107
// Method specifies the HTTP method (GET, POST, PUT, etc.).
108-
// For client requests an empty string means GET.
108+
// For client requests, an empty string means GET.
109109
//
110110
// Go's HTTP client does not support sending a request with
111111
// the CONNECT method. See the documentation on Transport for
@@ -115,7 +115,7 @@ type Request struct {
115115
// URL specifies either the URI being requested (for server
116116
// requests) or the URL to access (for client requests).
117117
//
118-
// For server requests the URL is parsed from the URI
118+
// For server requests, the URL is parsed from the URI
119119
// supplied on the Request-Line as stored in RequestURI. For
120120
// most requests, fields other than Path and RawQuery will be
121121
// empty. (See RFC 7230, Section 5.3)
@@ -128,7 +128,7 @@ type Request struct {
128128

129129
// The protocol version for incoming server requests.
130130
//
131-
// For client requests these fields are ignored. The HTTP
131+
// For client requests, these fields are ignored. The HTTP
132132
// client code always uses either HTTP/1.1 or HTTP/2.
133133
// See the docs on Transport for details.
134134
Proto string // "HTTP/1.0"
@@ -170,11 +170,11 @@ type Request struct {
170170

171171
// Body is the request's body.
172172
//
173-
// For client requests a nil body means the request has no
173+
// For client requests, a nil body means the request has no
174174
// body, such as a GET request. The HTTP Client's Transport
175175
// is responsible for calling the Close method.
176176
//
177-
// For server requests the Request Body is always non-nil
177+
// For server requests, the Request Body is always non-nil
178178
// but will return EOF immediately when no body is present.
179179
// The Server will close the request body. The ServeHTTP
180180
// Handler does not need to.
@@ -185,13 +185,14 @@ type Request struct {
185185
// reading the body more than once. Use of GetBody still
186186
// requires setting Body.
187187
//
188-
// For server requests it is unused.
188+
// For server requests, it is unused.
189189
GetBody func() (io.ReadCloser, error)
190190

191191
// ContentLength records the length of the associated content.
192192
// The value -1 indicates that the length is unknown.
193193
// Values >= 0 indicate that the given number of bytes may
194194
// be read from Body.
195+
//
195196
// For client requests, a value of 0 with a non-nil Body is
196197
// also treated as unknown.
197198
ContentLength int64
@@ -215,7 +216,7 @@ type Request struct {
215216
// Transport.DisableKeepAlives were set.
216217
Close bool
217218

218-
// For server requests Host specifies the host on which the URL
219+
// For server requests, Host specifies the host on which the URL
219220
// is sought. Per RFC 7230, section 5.4, this is either the value
220221
// of the "Host" header or the host name given in the URL itself.
221222
// It may be of the form "host:port". For international domain
@@ -228,7 +229,7 @@ type Request struct {
228229
// ServeMux supports patterns registered to particular host
229230
// names and thus protects its registered Handlers.
230231
//
231-
// For client requests Host optionally overrides the Host
232+
// For client requests, Host optionally overrides the Host
232233
// header to send. If empty, the Request.Write method uses
233234
// the value of URL.Host. Host may contain an international
234235
// domain name.
@@ -255,14 +256,14 @@ type Request struct {
255256
// Trailer specifies additional headers that are sent after the request
256257
// body.
257258
//
258-
// For server requests the Trailer map initially contains only the
259+
// For server requests, the Trailer map initially contains only the
259260
// trailer keys, with nil values. (The client declares which trailers it
260261
// will later send.) While the handler is reading from Body, it must
261262
// not reference Trailer. After reading from Body returns EOF, Trailer
262263
// can be read again and will contain non-nil values, if they were sent
263264
// by the client.
264265
//
265-
// For client requests Trailer must be initialized to a map containing
266+
// For client requests, Trailer must be initialized to a map containing
266267
// the trailer keys to later send. The values may be nil or their final
267268
// values. The ContentLength must be 0 or -1, to send a chunked request.
268269
// After the HTTP request is sent the map values can be updated while

0 commit comments

Comments
 (0)