This follows the spelling choices that the Go project has made for English words.
https://github.com/golang/go/wiki/Spelling
Change-Id: Ie7c586d2cf23020cb492cfff58c0831d2d8d3a78
GitHub-Last-Rev:
e16a32cd225a275f73d236bcb33703986d110ded
GitHub-Pull-Request: golang/go#45442
Reviewed-on: https://go-review.googlesource.com/c/go/+/308291
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
// +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
*/
import "C"
-import "testing"
-import "time"
+import (
+ "testing"
+ "time"
+)
func test6997(t *testing.T) {
r := C.StartThread()
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)
}
}
defer cancel6()
checkNoGoroutine()
- // Check applied to cancelled context.
+ // Check applied to canceled context.
cancel6()
cancel1()
_, cancel7 := WithCancel(ctx5)
// 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)
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
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)
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{
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++ {
// 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()
}
// 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) {
}
}
-// 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
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():
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
// 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()
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 {
// 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()