aboutsummaryrefslogtreecommitdiff
path: root/src/net/http
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2019-03-28 16:15:14 -0700
committerBrad Fitzpatrick <bradfitz@golang.org>2019-04-16 20:27:15 +0000
commit5781df421e721088f3ff6229f0e8d4e4c04765b8 (patch)
tree4f726e5bca753566c70f9c8d4957697996a9dcf7 /src/net/http
parent34b1f210462409f8c05d927a80d973b5692c1d26 (diff)
downloadgo-5781df421e721088f3ff6229f0e8d4e4c04765b8.tar.xz
all: s/cancelation/cancellation/
Though there is variation in the spelling of canceled, cancellation is always spelled with a double l. Reference: https://www.grammarly.com/blog/canceled-vs-cancelled/ Change-Id: I240f1a297776c8e27e74f3eca566d2bc4c856f2f Reviewed-on: https://go-review.googlesource.com/c/go/+/170060 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/net/http')
-rw-r--r--src/net/http/client.go6
-rw-r--r--src/net/http/http.go2
-rw-r--r--src/net/http/request.go2
-rw-r--r--src/net/http/socks_bundle.go2
-rw-r--r--src/net/http/transport.go8
-rw-r--r--src/net/http/transport_test.go2
6 files changed, 11 insertions, 11 deletions
diff --git a/src/net/http/client.go b/src/net/http/client.go
index 921f86bd92..aa54806c45 100644
--- a/src/net/http/client.go
+++ b/src/net/http/client.go
@@ -100,7 +100,7 @@ type Client struct {
// For compatibility, the Client will also use the deprecated
// CancelRequest method on Transport if found. New
// RoundTripper implementations should use the Request's Context
- // for cancelation instead of implementing CancelRequest.
+ // for cancellation instead of implementing CancelRequest.
Timeout time.Duration
}
@@ -643,7 +643,7 @@ func (c *Client) do(req *Request) (retres *Response, reterr error) {
reqBodyClosed = true
if !deadline.IsZero() && didTimeout() {
err = &httpError{
- // TODO: early in cycle: s/Client.Timeout exceeded/timeout or context cancelation/
+ // TODO: early in cycle: s/Client.Timeout exceeded/timeout or context cancellation/
err: err.Error() + " (Client.Timeout exceeded while awaiting headers)",
timeout: true,
}
@@ -870,7 +870,7 @@ func (b *cancelTimerBody) Read(p []byte) (n int, err error) {
}
if b.reqDidTimeout() {
err = &httpError{
- // TODO: early in cycle: s/Client.Timeout exceeded/timeout or context cancelation/
+ // TODO: early in cycle: s/Client.Timeout exceeded/timeout or context cancellation/
err: err.Error() + " (Client.Timeout exceeded while reading body)",
timeout: true,
}
diff --git a/src/net/http/http.go b/src/net/http/http.go
index 1c829ae87f..3510fe604d 100644
--- a/src/net/http/http.go
+++ b/src/net/http/http.go
@@ -19,7 +19,7 @@ import (
const maxInt64 = 1<<63 - 1
// aLongTimeAgo is a non-zero time, far in the past, used for
-// immediate cancelation of network operations.
+// immediate cancellation of network operations.
var aLongTimeAgo = time.Unix(1, 0)
// TODO(bradfitz): move common stuff here. The other files have accumulated
diff --git a/src/net/http/request.go b/src/net/http/request.go
index 24e941f038..da5ac2c71b 100644
--- a/src/net/http/request.go
+++ b/src/net/http/request.go
@@ -327,7 +327,7 @@ type Request struct {
// The returned context is always non-nil; it defaults to the
// background context.
//
-// For outgoing client requests, the context controls cancelation.
+// For outgoing client requests, the context controls cancellation.
//
// For incoming server requests, the context is canceled when the
// client's connection closes, the request is canceled (with HTTP/2),
diff --git a/src/net/http/socks_bundle.go b/src/net/http/socks_bundle.go
index e6640dd404..3a947a0c91 100644
--- a/src/net/http/socks_bundle.go
+++ b/src/net/http/socks_bundle.go
@@ -453,7 +453,7 @@ func (up *socksUsernamePassword) Authenticate(ctx context.Context, rw io.ReadWri
b = append(b, up.Username...)
b = append(b, byte(len(up.Password)))
b = append(b, up.Password...)
- // TODO(mikio): handle IO deadlines and cancelation if
+ // TODO(mikio): handle IO deadlines and cancellation if
// necessary
if _, err := rw.Write(b); err != nil {
return err
diff --git a/src/net/http/transport.go b/src/net/http/transport.go
index 6d82f44ff6..377914177f 100644
--- a/src/net/http/transport.go
+++ b/src/net/http/transport.go
@@ -1039,7 +1039,7 @@ func (t *Transport) getConn(treq *transportRequest, cm connectMethod) (*persistC
t.decHostConnCount(cmKey)
select {
case <-req.Cancel:
- // It was an error due to cancelation, so prioritize that
+ // It was an error due to cancellation, so prioritize that
// error value. (Issue 16049)
return nil, errRequestCanceledConn
case <-req.Context().Done():
@@ -1050,7 +1050,7 @@ func (t *Transport) getConn(treq *transportRequest, cm connectMethod) (*persistC
}
return nil, err
default:
- // It wasn't an error due to cancelation, so
+ // It wasn't an error due to cancellation, so
// return the original error message:
return nil, v.err
}
@@ -1557,7 +1557,7 @@ func (pc *persistConn) isBroken() bool {
}
// canceled returns non-nil if the connection was closed due to
-// CancelRequest or due to context cancelation.
+// CancelRequest or due to context cancellation.
func (pc *persistConn) canceled() error {
pc.mu.Lock()
defer pc.mu.Unlock()
@@ -1813,7 +1813,7 @@ func (pc *persistConn) readLoop() {
// Before looping back to the top of this function and peeking on
// the bufio.Reader, wait for the caller goroutine to finish
- // reading the response body. (or for cancelation or death)
+ // reading the response body. (or for cancellation or death)
select {
case bodyEOF := <-waitForBodyRead:
pc.t.setReqCanceler(rc.req, nil) // before pc might return to idle pool
diff --git a/src/net/http/transport_test.go b/src/net/http/transport_test.go
index 5b1dbf9eff..857f0d5928 100644
--- a/src/net/http/transport_test.go
+++ b/src/net/http/transport_test.go
@@ -2114,7 +2114,7 @@ func testCancelRequestWithChannelBeforeDo(t *testing.T, withCtx bool) {
}
} else {
if err == nil || !strings.Contains(err.Error(), "canceled") {
- t.Errorf("Do error = %v; want cancelation", err)
+ t.Errorf("Do error = %v; want cancellation", err)
}
}
}