Skip to content

Commit 4ec5c5a

Browse files
alexandearkirillDanshin
authored andcommittedAug 30, 2023
docs: fix typos in comments and tests
1 parent 9aa666e commit 4ec5c5a

7 files changed

+11
-11
lines changed
 

‎client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2013,7 +2013,7 @@ func (w *wantConn) cancel(c *HostClient, err error) {
20132013
//
20142014
// inspired by net/http/transport.go
20152015
type wantConnQueue struct {
2016-
// This is a queue, not a deque.
2016+
// This is a queue, not a dequeue.
20172017
// It is split into two stages - head[headPos:] and tail.
20182018
// popFront is trivial (headPos++) on the first stage, and
20192019
// pushBack is trivial (append) on the second stage.

‎fs_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ func testParseByteRangeSuccess(t *testing.T, v string, contentLength, startPos,
436436
t.Fatalf("unexpected startPos=%d. Expecting %d. v=%q, contentLength=%d", startPos1, startPos, v, contentLength)
437437
}
438438
if endPos1 != endPos {
439-
t.Fatalf("unexpected endPos=%d. Expectind %d. v=%q, contentLenght=%d", endPos1, endPos, v, contentLength)
439+
t.Fatalf("unexpected endPos=%d. Expecting %d. v=%q, contentLength=%d", endPos1, endPos, v, contentLength)
440440
}
441441
}
442442

‎header_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ func TestRequestHeaderProxyWithCookie(t *testing.T) {
12271227
t.Fatalf("unexpected Foo: %q. Expecting %q", h1.Peek("Foo"), "bar")
12281228
}
12291229
if string(h1.Cookie("foo")) != "bar" {
1230-
t.Fatalf("unexpected coookie foo=%q. Expecting %q", h1.Cookie("foo"), "bar")
1230+
t.Fatalf("unexpected cookie foo=%q. Expecting %q", h1.Cookie("foo"), "bar")
12311231
}
12321232
if string(h1.Cookie("bazzz")) != "aaaaaaa" {
12331233
t.Fatalf("unexpected cookie bazzz=%q. Expecting %q", h1.Cookie("bazzz"), "aaaaaaa")
@@ -2356,14 +2356,14 @@ func TestResponseHeaderReadSuccess(t *testing.T) {
23562356
t.Fatalf("expecting connection: close")
23572357
}
23582358

2359-
// tranfer-encoding: chunked
2359+
// transfer-encoding: chunked
23602360
testResponseHeaderReadSuccess(t, h, "HTTP/1.1 505 Internal error\r\nContent-Type: text/html\r\nTransfer-Encoding: chunked\r\n\r\n",
23612361
505, -1, "text/html")
23622362
if h.ConnectionClose() {
23632363
t.Fatalf("unexpected connection: close")
23642364
}
23652365

2366-
// reverse order of content-type and tranfer-encoding
2366+
// reverse order of content-type and transfer-encoding
23672367
testResponseHeaderReadSuccess(t, h, "HTTP/1.1 343 foobar\r\nTransfer-Encoding: chunked\r\nContent-Type: text/json\r\n\r\n",
23682368
343, -1, "text/json")
23692369

‎http_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,7 @@ func TestRequestMultipartForm(t *testing.T) {
15561556
formData = testRequestMultipartForm(t, boundary, formData, 10)
15571557
}
15581558

1559-
// verify request unmarshalling / marshalling
1559+
// verify request unmarshaling / marshaling
15601560
s := "POST / HTTP/1.1\r\nHost: aaa\r\nContent-Type: multipart/form-data; boundary=foobar\r\nContent-Length: 213\r\n\r\n--foobar\r\nContent-Disposition: form-data; name=\"key_0\"\r\n\r\nvalue_0\r\n--foobar\r\nContent-Disposition: form-data; name=\"key_1\"\r\n\r\nvalue_1\r\n--foobar\r\nContent-Disposition: form-data; name=\"key_2\"\r\n\r\nvalue_2\r\n--foobar--\r\n"
15611561

15621562
var req Request

‎server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ type Server struct {
403403
// instead.
404404
TLSConfig *tls.Config
405405

406-
// FormValueFunc, which is used by RequestCtx.FormValue and support for customising
406+
// FormValueFunc, which is used by RequestCtx.FormValue and support for customizing
407407
// the behaviour of the RequestCtx.FormValue function.
408408
//
409409
// NetHttpFormValueFunc gives a FormValueFunc func implementation that is consistent with net/http.

‎server_example_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func ExampleRequestCtx_TimeoutError() {
133133
time.Sleep(workDuration)
134134

135135
fmt.Fprintf(ctx, "ctx has been accessed by long-running task\n")
136-
fmt.Fprintf(ctx, "The reuqestHandler may be finished by this time.\n")
136+
fmt.Fprintf(ctx, "The requestHandler may be finished by this time.\n")
137137

138138
close(doneCh)
139139
}()

‎server_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,7 @@ func TestServerExpect100Continue(t *testing.T) {
18301830
}
18311831
ct := ctx.Request.Header.ContentType()
18321832
if string(ct) != "a/b" {
1833-
t.Errorf("unexpectected content-type: %q. Expecting %q", ct, "a/b")
1833+
t.Errorf("unexpected content-type: %q. Expecting %q", ct, "a/b")
18341834
}
18351835
if string(ctx.PostBody()) != "12345" {
18361836
t.Errorf("unexpected body: %q. Expecting %q", ctx.PostBody(), "12345")
@@ -1870,7 +1870,7 @@ func TestServerContinueHandler(t *testing.T) {
18701870

18711871
ct := headers.ContentType()
18721872
if string(ct) != "a/b" {
1873-
t.Errorf("unexpectected content-type: %q. Expecting %q", ct, "a/b")
1873+
t.Errorf("unexpected content-type: %q. Expecting %q", ct, "a/b")
18741874
}
18751875

18761876
// Pass on any request that isn't the accepted content length
@@ -1888,7 +1888,7 @@ func TestServerContinueHandler(t *testing.T) {
18881888
}
18891889
ct := ctx.Request.Header.ContentType()
18901890
if string(ct) != "a/b" {
1891-
t.Errorf("unexpectected content-type: %q. Expecting %q", ct, "a/b")
1891+
t.Errorf("unexpected content-type: %q. Expecting %q", ct, "a/b")
18921892
}
18931893
if string(ctx.PostBody()) != "12345" {
18941894
t.Errorf("unexpected body: %q. Expecting %q", ctx.PostBody(), "12345")

0 commit comments

Comments
 (0)
Please sign in to comment.