returns an "operation was canceled" error, the error will now
satisfy <code>errors.Is(err, context.Canceled)</code>.
These changes are intended to make it easier for code to test
- for cases in which a context cancelation or timeout causes a net
+ for cases in which a context cancellation or timeout causes a net
package function or method to return an error, while preserving
backward compatibility for error messages.
</p>
BFI $29, $2, R8 // 1881dee7
BFI $16, $8, R1, R2 // BFI $16, R1, $8, R2 // 1124d7e7
-// synthetic arithmatic
+// synthetic arithmetic
ADD $0xffffffaa, R2, R3 // ADD $4294967210, R2, R3 // 55b0e0e30b3082e0
ADD $0xffffff55, R5 // ADD $4294967125, R5 // aab0e0e30b5085e0
ADD.S $0xffffffab, R2, R3 // ADD.S $4294967211, R2, R3 // 54b0e0e30b3092e0
// the external linker will add DT_NEEDED
// entries as needed on ELF systems.
// Treat function variables differently
- // to avoid type confict errors from LTO
+ // to avoid type conflict errors from LTO
// (Link Time Optimization).
if n.Kind == "fpvar" {
fmt.Fprintf(fm, "extern void %s();\n", n.C)
sizeWithRz := rzSize + size
c = tconv(ir.NewInt(sizeWithRz), types.Types[types.TUINTPTR])
setField("sizeWithRedzone", c, i)
- // The C string type is terminated by a null charactor "\0", Go should use three-digit
+ // The C string type is terminated by a null character "\0", Go should use three-digit
// octal "\000" or two-digit hexadecimal "\x00" to create null terminated string.
// asanName = symbol's linkname + "\000"
// globals[i].name = (*defString)(unsafe.Pointer(&asanName)).data
}
if f.Nointerface() {
// In the case of a nointerface method on an instantiated
- // type, don't actually apppend the typeSig.
+ // type, don't actually append the typeSig.
continue
}
ms = append(ms, sig)
// non-equivalent arguments. Repeat until we can't find any
// more splits.
var splitPoints []int
- byArgClass := new(partitionByArgClass) // reuseable partitionByArgClass to reduce allocations
+ byArgClass := new(partitionByArgClass) // reusable partitionByArgClass to reduce allocations
for {
changed := false
(MOVHUloadidx ptr idx (MOVHstoreidx ptr2 idx x _)) && isSamePtr(ptr, ptr2) => (MOVHUreg x)
(MOVHloadidx ptr idx (MOVHstoreidx ptr2 idx x _)) && isSamePtr(ptr, ptr2) => (MOVHreg x)
-// fold constant into arithmatic ops
+// fold constant into arithmetic ops
(ADD x (MOVWconst [c])) => (ADDconst [c] x)
(SUB (MOVWconst [c]) x) => (RSBconst [c] x)
(SUB x (MOVWconst [c])) => (SUBconst [c] x)
// But for now, this is enough to get rid of lots of them.
(MOVDnop (MOVDconst [c])) => (MOVDconst [c])
-// fold constant into arithmatic ops
+// fold constant into arithmetic ops
(ADD x (MOVDconst [c])) => (ADDconst [c] x)
(SUB x (MOVDconst [c])) => (SUBconst [c] x)
(AND x (MOVDconst [c])) => (ANDconst [c] x)
// MOVVnop doesn't emit instruction, only for ensuring the type.
(MOVVreg x) && x.Uses == 1 => (MOVVnop x)
-// fold constant into arithmatic ops
+// fold constant into arithmetic ops
(ADDV x (MOVVconst [c])) && is32Bit(c) => (ADDVconst [c] x)
(SUBV x (MOVVconst [c])) && is32Bit(c) => (SUBVconst [c] x)
(AND x (MOVVconst [c])) && is32Bit(c) => (ANDconst [c] x)
// But for now, this is enough to get rid of lots of them.
(MOVWnop (MOVWconst [c])) => (MOVWconst [c])
-// fold constant into arithmatic ops
+// fold constant into arithmetic ops
(ADD x (MOVWconst [c])) => (ADDconst [c] x)
(SUB x (MOVWconst [c])) => (SUBconst [c] x)
(AND x (MOVWconst [c])) => (ANDconst [c] x)
// But for now, this is enough to get rid of lots of them.
(MOVVnop (MOVVconst [c])) => (MOVVconst [c])
-// fold constant into arithmatic ops
+// fold constant into arithmetic ops
(ADDV x (MOVVconst [c])) && is32Bit(c) => (ADDVconst [c] x)
(SUBV x (MOVVconst [c])) && is32Bit(c) => (SUBVconst [c] x)
(AND x (MOVVconst [c])) && is32Bit(c) => (ANDconst [c] x)
po.upush(undoSetChr, uint32(idx), r)
}
- // Connect all chidren of i2s to i1 (unless those children
+ // Connect all children of i2s to i1 (unless those children
// are in i2s as well, in which case it would be useless)
if i2s.Test(uint32(idx)) {
if l != 0 && !i2s.Test(l.Target()) {
return fn != nil && fn.String() == name
}
-// canLoadUnaligned reports if the achitecture supports unaligned load operations
+// canLoadUnaligned reports if the architecture supports unaligned load operations
func canLoadUnaligned(c *Config) bool {
return c.ctxt.Arch.Alignment == 1
}
}
if argErr.Index != test.wantAt {
- t.Errorf("Instantate(%v, %v): error at index %d, want index %d", T, test.targs, argErr.Index, test.wantAt)
+ t.Errorf("Instantiate(%v, %v): error at index %d, want index %d", T, test.targs, argErr.Index, test.wantAt)
}
}
}
# go list -e -deps should list imports from any file it can read, even if
# other files in the same package cause go/build.Import to return an error.
-# Verfifies golang.org/issue/38568
+# Verifies golang.org/issue/38568
go list -e -deps ./scan
stdout m/want
length := int64(0)
if idx+1 < len(syms) {
// Find the next top-level symbol.
- // Skip over sub symbols so we won't split a containter symbol
+ // Skip over sub symbols so we won't split a container symbol
// into two blocks.
next := syms[idx+1]
for ldr.AttrSubSymbol(next) {
}
if len(cert.PermittedEmailAddresses) != 1 || cert.PermittedEmailAddresses[0] != "foo@example.com" {
- t.Errorf("%s: failed to parse permitted email addreses: %#v", test.name, cert.PermittedEmailAddresses)
+ t.Errorf("%s: failed to parse permitted email addresses: %#v", test.name, cert.PermittedEmailAddresses)
}
if len(cert.ExcludedEmailAddresses) != 2 || cert.ExcludedEmailAddresses[0] != ".example.com" || cert.ExcludedEmailAddresses[1] != "example.com" {
- t.Errorf("%s: failed to parse excluded email addreses: %#v", test.name, cert.ExcludedEmailAddresses)
+ t.Errorf("%s: failed to parse excluded email addresses: %#v", test.name, cert.ExcludedEmailAddresses)
}
if len(cert.PermittedURIDomains) != 2 || cert.PermittedURIDomains[0] != ".bar.com" || cert.PermittedURIDomains[1] != "bar.com" {
}
if c.stickyBad || (hookPrepareBadConn != nil && hookPrepareBadConn()) {
- return nil, fakeError{Message: "Preapre: Sticky Bad", Wrapped: driver.ErrBadConn}
+ return nil, fakeError{Message: "Prepare: Sticky Bad", Wrapped: driver.ErrBadConn}
}
c.touchMem()
}
if argErr.Index != test.wantAt {
- t.Errorf("Instantate(%v, %v): error at index %d, want index %d", T, test.targs, argErr.Index, test.wantAt)
+ t.Errorf("Instantiate(%v, %v): error at index %d, want index %d", T, test.targs, argErr.Index, test.wantAt)
}
}
}
"var a T1; type ( T1 T2; T2 interface{ f() } )": {{"f", []int{0}, true}},
"var a T1; type ( T1 interface{ T2 }; T2 interface{ f() } )": {{"f", []int{0}, true}},
- // Genric interfaces
+ // Generic interfaces
"var a T[int]; type T[P any] interface{ f() }": {{"f", []int{0}, true}},
"var a T1[int]; type ( T1[P any] T2[P]; T2[P any] interface{ f() } )": {{"f", []int{0}, true}},
"var a T1[int]; type ( T1[P any] interface{ T2[P] }; T2[P any] interface{ f() } )": {{"f", []int{0}, true}},
t.Fatalf("readImg: %v", err)
}
- // Case 1: Enocde a wrapped image.Image
+ // Case 1: Encode a wrapped image.Image
buf := new(bytes.Buffer)
w0 := offsetImage{m0, m0.Bounds()}
err = Encode(buf, w0, nil)
t.Fatalf("Wrapped: average delta is too high. expected: 0, got %d", avgDelta)
}
- // Case 2: Enocde a wrapped image.Image with offset
+ // Case 2: Encode a wrapped image.Image with offset
b0 := image.Rectangle{
Min: image.Point{
X: 128,
if ctx.Done() != nil {
// CloseNotifier predates context.Context, and has been
// entirely superseded by it. If the request contains
- // a Context that carries a cancelation signal, don't
+ // a Context that carries a cancellation signal, don't
// bother spinning up a goroutine to watch the CloseNotify
// channel (if any).
//
// If the request Context has a nil Done channel (which
// means it is either context.Background, or a custom
- // Context implementation with no cancelation signal),
+ // Context implementation with no cancellation signal),
// then consult the CloseNotifier if available.
} else if cn, ok := rw.(http.CloseNotifier); ok {
var cancel context.CancelFunc
r2c := <-reqc
cancel()
- // Give the cancelation a moment to take effect, and then unblock the first request.
+ // Give the cancellation a moment to take effect, and then unblock the first request.
time.Sleep(1 * time.Millisecond)
close(idlec)
// Unmap returns ip with any IPv4-mapped IPv6 address prefix removed.
//
-// That is, if ip is an IPv6 address wrapping an IPv4 adddress, it
+// That is, if ip is an IPv6 address wrapping an IPv4 address, it
// returns the wrapped IPv4 address. Otherwise it returns ip unmodified.
func (ip Addr) Unmap() Addr {
if ip.Is4In6() {
//
// This operation is idempotent for memory already in the Prepared state, so
// it is safe to refer, with v and n, to a range of memory that includes both
-// Prepared and Ready memory. However, the caller must provide the exact amout
+// Prepared and Ready memory. However, the caller must provide the exact amount
// of Prepared memory for accounting purposes.
func sysUsed(v unsafe.Pointer, n, prepared uintptr) {
gcController.mappedReady.Add(int64(prepared))
// CPU time and drains with mutator time. Because the bucket fills and
// drains with time directly (i.e. without any weighting), this effectively
// sets a very conservative limit of 50%. This limit could be enforced directly,
-// however, but the purpose of the bucket is to accomodate spikes in GC CPU
+// however, but the purpose of the bucket is to accommodate spikes in GC CPU
// utilization without hurting throughput.
//
// Note that the bucket in the leaky bucket mechanism can never go negative,
// New goroutines may not be in this list, but we didn't want to know about
// them anyway. If they do appear in this list (via reusing a dead goroutine
// struct, or racing to launch between the world restarting and us getting
- // the list), they will aleady have their goroutineProfiled field set to
+ // the list), they will already have their goroutineProfiled field set to
// goroutineProfileSatisfied before their state transitions out of _Gdead.
//
// Any goroutine that the scheduler tries to execute concurrently with this
// Go will never generate a stack trace containing such an address, as it is
// not a valid call site. However, the cgo traceback function passed to
// runtime.SetCgoTraceback may not be completely accurate and may incorrect
-// provide PCs in Go code or the alignement region between functions.
+// provide PCs in Go code or the alignment region between functions.
//
// Go obviously doesn't easily expose the problematic PCs to running programs,
// so this test is a bit fragile. Some details: