all: fix spellings

This follows the spelling choices that the Go project has made for English words.
https://github.com/golang/go/wiki/Spelling
This commit is contained in:
Naman Gera 2021-04-08 12:37:11 +05:30
parent 8752454ece
commit 8975577b4e
14 changed files with 29 additions and 27 deletions

View File

@ -5,7 +5,7 @@
// +build !android
// Test that pthread_cancel works as expected
// (NPTL uses SIGRTMIN to implement thread cancelation)
// (NPTL uses SIGRTMIN to implement thread cancellation)
// See https://golang.org/issue/6997
package cgotest
@ -17,8 +17,10 @@ extern int CancelThread();
*/
import "C"
import "testing"
import "time"
import (
"testing"
"time"
)
func test6997(t *testing.T) {
r := C.StartThread()

View File

@ -3995,7 +3995,7 @@ function create(node, id, self) {
}
// Cancel any pre-empted transitions. No interrupt event is dispatched
// because the cancelled transitions never started. Note that this also
// because the canceled transitions never started. Note that this also
// removes this transition from the pending list!
else if (+i < id) {
o.state = ENDED;

View File

@ -22,8 +22,8 @@ const Doc = `check cancel func returned by context.WithCancel is called
The cancellation function returned by context.WithCancel, WithTimeout,
and WithDeadline must be called or the new context will remain live
until its parent context is cancelled.
(The background context is never cancelled.)`
until its parent context is canceled.
(The background context is never canceled.)`
var Analyzer = &analysis.Analyzer{
Name: "lostcancel",

View File

@ -661,7 +661,7 @@ func XTestWithCancelCanceledParent(t testingT) {
t.Errorf("child not done immediately upon construction")
}
if got, want := c.Err(), Canceled; got != want {
t.Errorf("child not cancelled; got = %v, want = %v", got, want)
t.Errorf("child not canceled; got = %v, want = %v", got, want)
}
}
@ -779,7 +779,7 @@ func XTestCustomContextGoroutines(t testingT) {
defer cancel6()
checkNoGoroutine()
// Check applied to cancelled context.
// Check applied to canceled context.
cancel6()
cancel1()
_, cancel7 := WithCancel(ctx5)

View File

@ -1989,7 +1989,7 @@ func TestServerHandshakeContextCancellation(t *testing.T) {
// TestHandshakeContextHierarchy tests whether the contexts
// available to GetClientCertificate and GetCertificate are
// derived from the context provided to HandshakeContext, and
// that those contexts are cancelled after HandshakeContext has
// that those contexts are canceled after HandshakeContext has
// returned.
func TestHandshakeContextHierarchy(t *testing.T) {
c, s := localPipe(t)
@ -2024,7 +2024,7 @@ func TestHandshakeContextHierarchy(t *testing.T) {
select {
case <-innerCtx.Done():
default:
t.Errorf("GetClientCertificate context was not cancelled after HandshakeContext returned.")
t.Errorf("GetClientCertificate context was not canceled after HandshakeContext returned.")
}
}()
var innerCtx context.Context
@ -2048,7 +2048,7 @@ func TestHandshakeContextHierarchy(t *testing.T) {
select {
case <-innerCtx.Done():
default:
t.Errorf("GetCertificate context was not cancelled after HandshakeContext returned.")
t.Errorf("GetCertificate context was not canceled after HandshakeContext returned.")
}
if err := <-clientErr; err != nil {
t.Errorf("Unexpected client error: %v", err)

View File

@ -1795,7 +1795,7 @@ func (db *DB) beginDC(ctx context.Context, dc *driverConn, release func(error),
return nil, err
}
// Schedule the transaction to rollback when the context is cancelled.
// Schedule the transaction to rollback when the context is canceled.
// The cancel function in Tx will be called after done is set to true.
ctx, cancel := context.WithCancel(ctx)
tx = &Tx{

View File

@ -656,7 +656,7 @@ func TestPoolExhaustOnCancel(t *testing.T) {
db.SetMaxOpenConns(max)
// First saturate the connection pool.
// Then start new requests for a connection that is cancelled after it is requested.
// Then start new requests for a connection that is canceled after it is requested.
state = 1
for i := 0; i < max; i++ {
@ -2784,7 +2784,7 @@ func TestTxCannotCommitAfterRollback(t *testing.T) {
// 3. Check if 2.A has committed in Tx (pass) or outside of Tx (fail).
sendQuery := make(chan struct{})
// The Tx status is returned through the row results, ensure
// that the rows results are not cancelled.
// that the rows results are not canceled.
bypassRowsAwaitDone = true
hookTxGrabConn = func() {
cancel()

View File

@ -1945,7 +1945,7 @@ func TestClientDoCanceledVsTimeout_h2(t *testing.T) {
}
// Issue 33545: lock-in the behavior promised by Client.Do's
// docs about request cancelation vs timing out.
// docs about request cancellation vs timing out.
func testClientDoCanceledVsTimeout(t *testing.T, h2 bool) {
defer afterTest(t)
cst := newClientServerTest(t, h2, HandlerFunc(func(w ResponseWriter, r *Request) {

View File

@ -7359,7 +7359,7 @@ func (cc *http2ClientConn) Shutdown(ctx context.Context) error {
}
// Wait for all in-flight streams to complete or connection to close
done := make(chan error, 1)
cancelled := false // guarded by cc.mu
canceled := false // guarded by cc.mu
go func() {
cc.mu.Lock()
defer cc.mu.Unlock()
@ -7369,7 +7369,7 @@ func (cc *http2ClientConn) Shutdown(ctx context.Context) error {
done <- cc.tconn.Close()
break
}
if cancelled {
if canceled {
break
}
cc.cond.Wait()
@ -7382,7 +7382,7 @@ func (cc *http2ClientConn) Shutdown(ctx context.Context) error {
case <-ctx.Done():
cc.mu.Lock()
// Free the goroutine above
cancelled = true
canceled = true
cc.cond.Broadcast()
cc.mu.Unlock()
return ctx.Err()

View File

@ -478,7 +478,7 @@ func TestDumpResponse(t *testing.T) {
}
}
// Issue 38352: Check for deadlock on cancelled requests.
// Issue 38352: Check for deadlock on canceled requests.
func TestDumpRequestOutIssue38352(t *testing.T) {
if testing.Short() {
return

View File

@ -562,7 +562,7 @@ func (p *ReverseProxy) handleUpgradeResponse(rw http.ResponseWriter, req *http.R
backConnCloseCh := make(chan bool)
go func() {
// Ensure that the cancelation of a request closes the backend.
// Ensure that the cancellation of a request closes the backend.
// See issue https://golang.org/issue/35559.
select {
case <-req.Context().Done():

View File

@ -287,7 +287,7 @@ func (name handler) serveDeltaProfile(w http.ResponseWriter, r *http.Request, p
err := r.Context().Err()
if err == context.DeadlineExceeded {
serveError(w, http.StatusRequestTimeout, err.Error())
} else { // TODO: what's a good status code for cancelled requests? 400?
} else { // TODO: what's a good status code for canceled requests? 400?
serveError(w, http.StatusInternalServerError, err.Error())
}
return

View File

@ -1187,7 +1187,7 @@ type wantConn struct {
// hooks for testing to know when dials are done
// beforeDial is called in the getConn goroutine when the dial is queued.
// afterDial is called when the dial is completed or cancelled.
// afterDial is called when the dial is completed or canceled.
beforeDial func()
afterDial func()
@ -1375,7 +1375,7 @@ func (t *Transport) getConn(treq *transportRequest, cm connectMethod) (pc *persi
trace.GotConn(httptrace.GotConnInfo{Conn: w.pc.conn, Reused: w.pc.isReused()})
}
if w.err != nil {
// If the request has been cancelled, that's probably
// If the request has been canceled, that's probably
// what caused w.err; if so, prefer to return the
// cancellation error (see golang.org/issue/16049).
select {
@ -1437,7 +1437,7 @@ func (t *Transport) queueForDial(w *wantConn) {
// dialConnFor dials on behalf of w and delivers the result to w.
// dialConnFor has received permission to dial w.cm and is counted in t.connCount[w.cm.key()].
// If the dial is cancelled or unsuccessful, dialConnFor decrements t.connCount[w.cm.key()].
// If the dial is canceled or unsuccessful, dialConnFor decrements t.connCount[w.cm.key()].
func (t *Transport) dialConnFor(w *wantConn) {
defer w.afterDial()

View File

@ -143,7 +143,7 @@ func testPingPong(t *testing.T, c1, c2 net.Conn) {
}
// testRacyRead tests that it is safe to mutate the input Read buffer
// immediately after cancelation has occurred.
// immediately after cancellation has occurred.
func testRacyRead(t *testing.T, c1, c2 net.Conn) {
go chunkedCopy(c2, rand.New(rand.NewSource(0)))
@ -171,7 +171,7 @@ func testRacyRead(t *testing.T, c1, c2 net.Conn) {
}
// testRacyWrite tests that it is safe to mutate the input Write buffer
// immediately after cancelation has occurred.
// immediately after cancellation has occurred.
func testRacyWrite(t *testing.T, c1, c2 net.Conn) {
go chunkedCopy(ioutil.Discard, c2)
@ -319,7 +319,7 @@ func testCloseTimeout(t *testing.T, c1, c2 net.Conn) {
defer wg.Wait()
wg.Add(3)
// Test for cancelation upon connection closure.
// Test for cancellation upon connection closure.
c1.SetDeadline(neverTimeout)
go func() {
defer wg.Done()