]> Cypherpunks repositories - gostls13.git/commitdiff
all: s/cancelation/cancellation/
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 28 Mar 2019 23:15:14 +0000 (16:15 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 16 Apr 2019 20:27:15 +0000 (20:27 +0000)
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>
22 files changed:
src/cmd/compile/internal/gc/ssa.go
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go
src/context/context.go
src/context/context_test.go
src/context/example_test.go
src/database/sql/sql.go
src/internal/poll/fd_windows.go
src/math/j0.go
src/math/j1.go
src/net/dial.go
src/net/dial_test.go
src/net/http/client.go
src/net/http/http.go
src/net/http/request.go
src/net/http/socks_bundle.go
src/net/http/transport.go
src/net/http/transport_test.go
src/net/lookup.go
src/net/net.go
src/os/timeout_test.go
src/runtime/signal_solaris.go
src/vendor/golang.org/x/net/nettest/conntest.go

index 6c063623851df7a451ba740757affb91a0292875..8159dc7bcad74f9716ed23277305cad381203666 100644 (file)
@@ -2094,7 +2094,7 @@ func (s *state) expr(n *Node) *ssa.Value {
                        addop := ssa.OpAdd64F
                        subop := ssa.OpSub64F
                        pt := floatForComplex(n.Type) // Could be Float32 or Float64
-                       wt := types.Types[TFLOAT64]   // Compute in Float64 to minimize cancelation error
+                       wt := types.Types[TFLOAT64]   // Compute in Float64 to minimize cancellation error
 
                        areal := s.newValue1(ssa.OpComplexReal, pt, a)
                        breal := s.newValue1(ssa.OpComplexReal, pt, b)
@@ -2137,7 +2137,7 @@ func (s *state) expr(n *Node) *ssa.Value {
                        subop := ssa.OpSub64F
                        divop := ssa.OpDiv64F
                        pt := floatForComplex(n.Type) // Could be Float32 or Float64
-                       wt := types.Types[TFLOAT64]   // Compute in Float64 to minimize cancelation error
+                       wt := types.Types[TFLOAT64]   // Compute in Float64 to minimize cancellation error
 
                        areal := s.newValue1(ssa.OpComplexReal, pt, a)
                        breal := s.newValue1(ssa.OpComplexReal, pt, b)
index b5161836a57a23ce79921360e636222c1f08f47f..5be1ef0d577a9063fa99d29254d7679ac0e73789 100644 (file)
@@ -3,7 +3,7 @@
 // license that can be found in the LICENSE file.
 
 // Package lostcancel defines an Analyzer that checks for failure to
-// call a context cancelation function.
+// call a context cancellation function.
 package lostcancel
 
 import (
@@ -20,7 +20,7 @@ import (
 
 const Doc = `check cancel func returned by context.WithCancel is called
 
-The cancelation function returned by context.WithCancel, WithTimeout,
+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.)`
index ad67d2301d15bf6e70eba525d074e7277b6c87c1..93bf5b627d5f8f3ad245341c840951aece87ad15 100644 (file)
@@ -3,7 +3,7 @@
 // license that can be found in the LICENSE file.
 
 // Package context defines the Context type, which carries deadlines,
-// cancelation signals, and other request-scoped values across API boundaries
+// cancellation signals, and other request-scoped values across API boundaries
 // and between processes.
 //
 // Incoming requests to a server should create a Context, and outgoing
@@ -54,7 +54,7 @@ import (
        "time"
 )
 
-// A Context carries a deadline, a cancelation signal, and other values across
+// A Context carries a deadline, a cancellation signal, and other values across
 // API boundaries.
 //
 // Context's methods may be called by multiple goroutines simultaneously.
@@ -92,7 +92,7 @@ type Context interface {
        //  }
        //
        // See https://blog.golang.org/pipelines for more examples of how to use
-       // a Done channel for cancelation.
+       // a Done channel for cancellation.
        Done() <-chan struct{}
 
        // If Done is not yet closed, Err returns nil.
index 0cec1699158189785c498796b0ec8366e5da0cf0..0e69e2f6fdefa85a0ea8bc24b78daf0845bb4b1b 100644 (file)
@@ -94,7 +94,7 @@ func XTestWithCancel(t testingT) {
        }
 
        cancel()
-       time.Sleep(100 * time.Millisecond) // let cancelation propagate
+       time.Sleep(100 * time.Millisecond) // let cancellation propagate
 
        for i, c := range contexts {
                select {
@@ -306,7 +306,7 @@ func XTestCanceledTimeout(t testingT) {
        o := otherContext{c}
        c, cancel := WithTimeout(o, 2*time.Second)
        cancel()
-       time.Sleep(100 * time.Millisecond) // let cancelation propagate
+       time.Sleep(100 * time.Millisecond) // let cancellation propagate
        select {
        case <-c.Done():
        default:
index 2b28b577042d6a8d71074d75591f70106a91d793..b91a8acef3a9588e7c786239000f3039c53dd57e 100644 (file)
@@ -59,7 +59,7 @@ func ExampleWithDeadline() {
        ctx, cancel := context.WithDeadline(context.Background(), d)
 
        // Even though ctx will be expired, it is good practice to call its
-       // cancelation function in any case. Failure to do so may keep the
+       // cancellation function in any case. Failure to do so may keep the
        // context and its parent alive longer than necessary.
        defer cancel()
 
index 3b3ac274364560357eeaf509854d7eade7ce3393..5013505cd97934bf6beebdf232251dcf4c88d8bf 100644 (file)
@@ -8,7 +8,7 @@
 // The sql package must be used in conjunction with a database driver.
 // See https://golang.org/s/sqldrivers for a list of drivers.
 //
-// Drivers that do not support context cancelation will not return until
+// Drivers that do not support context cancellation will not return until
 // after the query is completed.
 //
 // For usage examples, see the wiki page at
index 92bab5f9dd9724dd2c67d54e31fd0aa555212735..f96e441abe17e047325ee96fa8a447670d4f4bba 100644 (file)
@@ -258,7 +258,7 @@ func (s *ioSrv) ExecIO(o *operation, submit func(o *operation) error) (int, erro
                s.req <- ioSrvReq{o, nil}
                <-o.errc
        }
-       // Wait for cancelation to complete.
+       // Wait for cancellation to complete.
        fd.pd.waitCanceled(int(o.mode))
        if o.errno != 0 {
                err = syscall.Errno(o.errno)
@@ -267,8 +267,8 @@ func (s *ioSrv) ExecIO(o *operation, submit func(o *operation) error) (int, erro
                }
                return 0, err
        }
-       // We issued a cancelation request. But, it seems, IO operation succeeded
-       // before the cancelation request run. We need to treat the IO operation as
+       // We issued a cancellation request. But, it seems, IO operation succeeded
+       // before the cancellation request run. We need to treat the IO operation as
        // succeeded (the bytes are actually sent/recv from network).
        return int(o.qty), nil
 }
index 5523fc34a001f1543f2b1fd47d61bb61dd79a7d8..cb5f07bca63f542715f92448c1faaf11cca5b5a1 100644 (file)
@@ -38,7 +38,7 @@ package math
 //                      = 1/sqrt(2) * (cos(x) + sin(x))
 //              sin(x0) = sin(x)cos(pi/4)-cos(x)sin(pi/4)
 //                      = 1/sqrt(2) * (sin(x) - cos(x))
-//         (To avoid cancelation, use
+//         (To avoid cancellation, use
 //              sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
 //         to compute the worse one.)
 //
@@ -186,7 +186,7 @@ func Y0(x float64) float64 {
                //             =  1/sqrt(2) * (sin(x) + cos(x))
                //     sin(x0) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
                //             =  1/sqrt(2) * (sin(x) - cos(x))
-               // To avoid cancelation, use
+               // To avoid cancellation, use
                //     sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
                // to compute the worse one.
 
index f1adcb6f41670f627572007fc24fd8b882d460ce..7c7d279730dc634dc4d91b7d4c78f39b0c795936 100644 (file)
@@ -39,7 +39,7 @@ package math
 //                      =  1/sqrt(2) * (sin(x) - cos(x))
 //              sin(x1) =  sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
 //                      = -1/sqrt(2) * (sin(x) + cos(x))
-//         (To avoid cancelation, use
+//         (To avoid cancellation, use
 //              sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
 //         to compute the worse one.)
 //
@@ -197,7 +197,7 @@ func Y1(x float64) float64 {
                //                 =  1/sqrt(2) * (sin(x) - cos(x))
                //         sin(x0) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
                //                 = -1/sqrt(2) * (cos(x) + sin(x))
-               // To avoid cancelation, use
+               // To avoid cancellation, use
                //     sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
                // to compute the worse one.
 
index 1f3ce1dfa323ea8c4759f0e6421de59b4287c1f9..7c03b54ceb9b2bce02b01499a1656587c9804a32 100644 (file)
@@ -76,7 +76,7 @@ type Dialer struct {
 
        // Cancel is an optional channel whose closure indicates that
        // the dial should be canceled. Not all types of dials support
-       // cancelation.
+       // cancellation.
        //
        // Deprecated: Use DialContext instead.
        Cancel <-chan struct{}
index 3a2c59a2d1d6be90dba1db1eaa15f7080860097e..3646ab9815cd2bb3f4997f047db7331bbe33e991 100644 (file)
@@ -463,7 +463,7 @@ func TestDialParallelSpuriousConnection(t *testing.T) {
        origTestHookDialTCP := testHookDialTCP
        defer func() { testHookDialTCP = origTestHookDialTCP }()
        testHookDialTCP = func(ctx context.Context, net string, laddr, raddr *TCPAddr) (*TCPConn, error) {
-               // Sleep long enough for Happy Eyeballs to kick in, and inhibit cancelation.
+               // Sleep long enough for Happy Eyeballs to kick in, and inhibit cancellation.
                // This forces dialParallel to juggle two successful connections.
                time.Sleep(fallbackDelay * 2)
 
@@ -865,7 +865,7 @@ func TestCancelAfterDial(t *testing.T) {
                d := &Dialer{Cancel: cancel}
                c, err := d.Dial("tcp", ln.Addr().String())
 
-               // Immediately after dialing, request cancelation and sleep.
+               // Immediately after dialing, request cancellation and sleep.
                // Before Issue 15078 was fixed, this would cause subsequent operations
                // to fail with an i/o timeout roughly 50% of the time.
                close(cancel)
index 921f86bd92dc742e18891837544787a034e11bb3..aa54806c45a02ff6c9fc99c1f01716ae6afcbb28 100644 (file)
@@ -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,
                }
index 1c829ae87ff2a4a47c16e3a3e8e75ede19eed208..3510fe604d091a220004df33d5f8e27dd5c39105 100644 (file)
@@ -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
index 24e941f03869a0c321af1250213ac5e08a47d185..da5ac2c71b718a415bb98cfced882236544b993f 100644 (file)
@@ -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),
index e6640dd404df285712b7294f6abdf74d9aece36a..3a947a0c9179b40723d52b58fdeb94feed08066d 100644 (file)
@@ -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
index 6d82f44ff695704240f492c0c4cbf1900e2312bb..377914177f78a368ffbe681341f45dca5f2a33cb 100644 (file)
@@ -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
index 5b1dbf9efff8f5345c0b0195dab5595278111e02..857f0d59288f58da460cd4a6af33575ddbb63fa8 100644 (file)
@@ -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)
                }
        }
 }
index 08e8d013855f4f9123544508be2fe2042a1cadf3..0af1e2c28904a7b451c6497ef5f32a0783688811 100644 (file)
@@ -255,7 +255,7 @@ func (r *Resolver) lookupIPAddr(ctx context.Context, network, host string) ([]IP
                resolverFunc = alt
        }
 
-       // We don't want a cancelation of ctx to affect the
+       // We don't want a cancellation of ctx to affect the
        // lookupGroup operation. Otherwise if our context gets
        // canceled it might cause an error to be returned to a lookup
        // using a completely different context. However we need to preserve
index 3bdccc8468a04afe37ef08da7e61fecf615058b3..b44ecb6711fae2a331d066effe2884ecf346fa71 100644 (file)
@@ -473,7 +473,7 @@ func (e *OpError) Error() string {
 
 var (
        // aLongTimeAgo is a non-zero time, far in the past, used for
-       // immediate cancelation of dials.
+       // immediate cancellation of dials.
        aLongTimeAgo = time.Unix(1, 0)
 
        // nonDeadline and noCancel are just zero values for
index 4720738d247878f01680e2fbaf991108a24f0964..5d7ea7ea29cb8083a64cdf8e44b3edcaf3460e36 100644 (file)
@@ -514,7 +514,7 @@ func TestReadWriteDeadlineRace(t *testing.T) {
 }
 
 // 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) {
        t.Parallel()
 
@@ -553,7 +553,7 @@ func TestRacyRead(t *testing.T) {
 }
 
 // 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) {
        t.Parallel()
 
index a8eeeee129e1f603fe4fb0b1932bdfd10e24e9c4..25f8ad55a6a4058c082d8495e9a44e916387d868 100644 (file)
@@ -41,7 +41,7 @@ var sigtable = [...]sigTabT{
        /* 33 */ {_SigNotify, "SIGLWP: reserved signal no longer used by"},
        /* 34 */ {_SigNotify, "SIGFREEZE: special signal used by CPR"},
        /* 35 */ {_SigNotify, "SIGTHAW: special signal used by CPR"},
-       /* 36 */ {_SigSetStack + _SigUnblock, "SIGCANCEL: reserved signal for thread cancellation"}, // Oracle's spelling of cancelation.
+       /* 36 */ {_SigSetStack + _SigUnblock, "SIGCANCEL: reserved signal for thread cancellation"}, // Oracle's spelling of cancellation.
        /* 37 */ {_SigNotify, "SIGLOST: resource lost (eg, record-lock lost)"},
        /* 38 */ {_SigNotify, "SIGXRES: resource control exceeded"},
        /* 39 */ {_SigNotify, "SIGJVM1: reserved signal for Java Virtual Machine"},
index 5bd3a8c68c587bd0f76a5fa066706d32498fb3f9..adbcaf02c671b321dd11561288f00390a4c6d3dd 100644 (file)
@@ -138,7 +138,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)))
 
@@ -166,7 +166,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)
 
@@ -314,7 +314,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()