Skip to content

Commit e15a810

Browse files
authored
docs: fix grammar issues and typos in comments (valyala#1492)
1 parent 5147cec commit e15a810

File tree

12 files changed

+29
-29
lines changed

12 files changed

+29
-29
lines changed

client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ type HostClient struct {
687687
// listed in Addr.
688688
//
689689
// You can change this value while the HostClient is being used
690-
// using HostClient.SetMaxConns(value)
690+
// with HostClient.SetMaxConns(value)
691691
//
692692
// DefaultMaxConnsPerHost is used if not set.
693693
MaxConns int

client_example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

99
func ExampleHostClient() {
10-
// Perpare a client, which fetches webpages via HTTP proxy listening
10+
// Prepare a client, which fetches webpages via HTTP proxy listening
1111
// on the localhost:8080.
1212
c := &fasthttp.HostClient{
1313
Addr: "localhost:8080",

compress.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ func newCompressWriterPoolMap() []*sync.Pool {
413413
}
414414

415415
func isFileCompressible(f *os.File, minCompressRatio float64) bool {
416-
// Try compressing the first 4kb of of the file
416+
// Try compressing the first 4kb of the file
417417
// and see if it can be compressed by more than
418418
// the given minCompressRatio.
419419
b := bytebufferpool.Get()

fasthttpadaptor/request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
// ConvertRequest convert a fasthttp.Request to an http.Request
14-
// forServer should be set to true when the http.Request is going to passed to a http.Handler.
14+
// forServer should be set to true when the http.Request is going to be passed to a http.Handler.
1515
//
1616
// The http.Request must not be used after the fasthttp handler has returned!
1717
// Memory in use by the http.Request will be reused after your handler has returned!

fasthttpproxy/proxy_env.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const (
2020
)
2121

2222
// FasthttpProxyHTTPDialer returns a fasthttp.DialFunc that dials using
23-
// the the env(HTTP_PROXY, HTTPS_PROXY and NO_PROXY) configured HTTP proxy.
23+
// the env(HTTP_PROXY, HTTPS_PROXY and NO_PROXY) configured HTTP proxy.
2424
//
2525
// Example usage:
2626
//

fs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@ func (h *fsHandler) openFSFile(filePath string, mustCompress bool, fileEncoding
13041304
}
13051305

13061306
// Only re-create the compressed file if there was more than a second between the mod times.
1307-
// On MacOS the gzip seems to truncate the nanoseconds in the mod time causing the original file
1307+
// On macOS the gzip seems to truncate the nanoseconds in the mod time causing the original file
13081308
// to look newer than the gzipped file.
13091309
if fileInfoOriginal.ModTime().Sub(fileInfo.ModTime()) >= time.Second {
13101310
// The compressed file became stale. Re-create it.

fs_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func TestPathNotFoundFunc(t *testing.T) {
111111
}
112112

113113
func TestServeFileHead(t *testing.T) {
114-
// This test can't run parallel as files in / might by changed by other tests.
114+
// This test can't run parallel as files in / might be changed by other tests.
115115

116116
var ctx RequestCtx
117117
var req Request
@@ -199,7 +199,7 @@ func (pw pureWriter) Write(p []byte) (nn int, err error) {
199199
}
200200

201201
func TestServeFileCompressed(t *testing.T) {
202-
// This test can't run parallel as files in / might by changed by other tests.
202+
// This test can't run parallel as files in / might be changed by other tests.
203203

204204
var ctx RequestCtx
205205
ctx.Init(&Request{}, nil, nil)
@@ -265,7 +265,7 @@ func TestServeFileCompressed(t *testing.T) {
265265
}
266266

267267
func TestServeFileUncompressed(t *testing.T) {
268-
// This test can't run parallel as files in / might by changed by other tests.
268+
// This test can't run parallel as files in / might be changed by other tests.
269269

270270
var ctx RequestCtx
271271
var req Request
@@ -298,7 +298,7 @@ func TestServeFileUncompressed(t *testing.T) {
298298
}
299299

300300
func TestFSByteRangeConcurrent(t *testing.T) {
301-
// This test can't run parallel as files in / might by changed by other tests.
301+
// This test can't run parallel as files in / might be changed by other tests.
302302

303303
stop := make(chan struct{})
304304
defer close(stop)
@@ -332,7 +332,7 @@ func TestFSByteRangeConcurrent(t *testing.T) {
332332
}
333333

334334
func TestFSByteRangeSingleThread(t *testing.T) {
335-
// This test can't run parallel as files in / might by changed by other tests.
335+
// This test can't run parallel as files in / might be changed by other tests.
336336

337337
stop := make(chan struct{})
338338
defer close(stop)
@@ -475,7 +475,7 @@ func testParseByteRangeError(t *testing.T, v string, contentLength int) {
475475
}
476476

477477
func TestFSCompressConcurrent(t *testing.T) {
478-
// Don't run this test on Windows, the Windows Github actions are to slow and timeout too often.
478+
// Don't run this test on Windows, the Windows GitHub actions are too slow and timeout too often.
479479
if runtime.GOOS == "windows" {
480480
t.SkipNow()
481481
}
@@ -517,7 +517,7 @@ func TestFSCompressConcurrent(t *testing.T) {
517517
}
518518

519519
func TestFSCompressSingleThread(t *testing.T) {
520-
// This test can't run parallel as files in / might by changed by other tests.
520+
// This test can't run parallel as files in / might be changed by other tests.
521521

522522
stop := make(chan struct{})
523523
defer close(stop)
@@ -617,7 +617,7 @@ func testFSCompress(t *testing.T, h RequestHandler, filePath string) {
617617
}
618618

619619
func TestFSHandlerSingleThread(t *testing.T) {
620-
// This test can't run parallel as files in / might by changed by other tests.
620+
// This test can't run parallel as files in / might be changed by other tests.
621621

622622
requestHandler := FSHandler(".", 0)
623623

@@ -639,7 +639,7 @@ func TestFSHandlerSingleThread(t *testing.T) {
639639
}
640640

641641
func TestFSHandlerConcurrent(t *testing.T) {
642-
// This test can't run parallel as files in / might by changed by other tests.
642+
// This test can't run parallel as files in / might be changed by other tests.
643643

644644
requestHandler := FSHandler(".", 0)
645645

@@ -787,7 +787,7 @@ func testFileExtension(t *testing.T, path string, compressed bool, compressedFil
787787
}
788788

789789
func TestServeFileContentType(t *testing.T) {
790-
// This test can't run parallel as files in / might by changed by other tests.
790+
// This test can't run parallel as files in / might be changed by other tests.
791791

792792
var ctx RequestCtx
793793
var req Request

header.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1495,7 +1495,7 @@ func (h *ResponseHeader) SetCanonical(key, value []byte) {
14951495

14961496
// SetCookie sets the given response cookie.
14971497
//
1498-
// It is save re-using the cookie after the function returns.
1498+
// It is safe re-using the cookie after the function returns.
14991499
func (h *ResponseHeader) SetCookie(cookie *Cookie) {
15001500
h.cookies = setArgBytes(h.cookies, cookie.Key(), cookie.Cookie(), argsHasValue)
15011501
}

http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ func (req *Request) parsePostArgs() {
893893
// isn't 'multipart/form-data'.
894894
var ErrNoMultipartForm = errors.New("request has no multipart/form-data Content-Type")
895895

896-
// MultipartForm returns requests's multipart form.
896+
// MultipartForm returns request's multipart form.
897897
//
898898
// Returns ErrNoMultipartForm if request's Content-Type
899899
// isn't 'multipart/form-data'.

lbclient.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func (cc *LBClient) DoTimeout(req *Request, resp *Response, timeout time.Duratio
7070
return cc.get().DoDeadline(req, resp, deadline)
7171
}
7272

73-
// Do calls calculates deadline using LBClient.Timeout and calls DoDeadline
73+
// Do calculates timeout using LBClient.Timeout and calls DoTimeout
7474
// on the least loaded client.
7575
func (cc *LBClient) Do(req *Request, resp *Response) error {
7676
timeout := cc.Timeout

0 commit comments

Comments
 (0)