]> Cypherpunks repositories - gostls13.git/commitdiff
src: fix typos
authorAlexander Cyon <alex.cyon@gmail.com>
Tue, 20 Aug 2024 17:54:39 +0000 (17:54 +0000)
committerGopher Robot <gobot@golang.org>
Tue, 20 Aug 2024 21:01:59 +0000 (21:01 +0000)
Fix typos in ~30 files

Change-Id: Ie433aea01e7d15944c1e9e103691784876d5c1f9
GitHub-Last-Rev: bbaeb3d1f88a5fa6bbb69607b1bd075f496a7894
GitHub-Pull-Request: golang/go#68964
Reviewed-on: https://go-review.googlesource.com/c/go/+/606955
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
23 files changed:
src/cmd/cgo/internal/testerrors/argposition_test.go
src/cmd/compile/internal/inline/inl.go
src/cmd/compile/internal/inline/inlheur/testdata/props/returns.go
src/cmd/compile/internal/liveness/mergelocals.go
src/cmd/compile/internal/pgoir/irgraph.go
src/cmd/compile/internal/ssagen/ssa.go
src/cmd/compile/internal/types2/signature.go
src/cmd/go/testdata/script/mod_list_direct_work.txt
src/cmd/internal/obj/loong64/doc.go
src/cmd/internal/obj/loong64/obj.go
src/cmd/link/internal/ld/elf_test.go
src/compress/flate/huffman_code.go
src/go/types/signature.go
src/internal/trace/event.go
src/internal/trace/internal/oldtrace/parser.go
src/internal/trace/testdata/generators/go122-create-syscall-reuse-thread-id.go
src/internal/trace/testdata/generators/go122-create-syscall-with-p.go
src/internal/trace/testdata/generators/go122-syscall-steal-proc-ambiguous.go
src/math/bits/bits_test.go
src/runtime/gc_test.go
src/runtime/mprof.go
src/runtime/os_linux.go
src/syscall/js/js_test.go

index 0876dc4caf35aac9704502be9540c8ca8617813b..b39cc3b3c8b3d0ec096caaff2ff0eb90d6d67f06 100644 (file)
@@ -41,16 +41,16 @@ func (v *Visitor) Visit(node ast.Node) ast.Visitor {
                        var errorMessage strings.Builder
                        for caseIndex, expectedPos := range expectedPositions {
                                actualPosition := v.fset.PositionFor(ident.Pos(), true)
-                               errorOccured := false
+                               errorOccurred := false
                                if expectedPos.Line != actualPosition.Line {
                                        fmt.Fprintf(&errorMessage, "wrong line number for ident %s: expected: %d got: %d\n", ident.Name, expectedPos.Line, actualPosition.Line)
-                                       errorOccured = true
+                                       errorOccurred = true
                                }
                                if expectedPos.Column != actualPosition.Column {
                                        fmt.Fprintf(&errorMessage, "wrong column number for ident %s: expected: %d got: %d\n", ident.Name, expectedPos.Column, actualPosition.Column)
-                                       errorOccured = true
+                                       errorOccurred = true
                                }
-                               if errorOccured {
+                               if errorOccurred {
                                        continue
                                }
                                gotMatch = true
index 513d2678f665951422c29ec81d2b1a2f1db6307c..c9b9e18eaf01489db3d043f7f497798d6b92f95b 100644 (file)
@@ -957,7 +957,7 @@ func canInlineCallExpr(callerfn *ir.Func, n *ir.CallExpr, callee *ir.Func, bigCa
        }
 
        if base.Debug.Checkptr != 0 && types.IsRuntimePkg(callee.Sym().Pkg) {
-               // We don't intrument runtime packages for checkptr (see base/flag.go).
+               // We don't instrument runtime packages for checkptr (see base/flag.go).
                if log && logopt.Enabled() {
                        logopt.LogOpt(n.Pos(), "cannotInlineCall", "inline", ir.FuncName(callerfn),
                                fmt.Sprintf(`call to into runtime package function %s in -d=checkptr build`, ir.PkgFuncName(callee)))
index 51f2bc7cb2d222aeefa70432d278e3eac1879d34..5e45a7bc230590ee2138505a7a790d8dbd2a173a 100644 (file)
@@ -88,14 +88,14 @@ func T_multi_return_nil(x, y bool) *Bar {
        return nil
 }
 
-// returns.go T_multi_return_nil_anomoly 98 0 1
+// returns.go T_multi_return_nil_anomaly 98 0 1
 // ResultFlags
 //   0 ResultIsConcreteTypeConvertedToInterface
 // <endpropsdump>
 // {"Flags":0,"ParamFlags":[0,0],"ResultFlags":[4]}
 // <endcallsites>
 // <endfuncpreamble>
-func T_multi_return_nil_anomoly(x, y bool) Itf {
+func T_multi_return_nil_anomaly(x, y bool) Itf {
        if x && y {
                var qnil *Q
                return qnil
index f33ebd0d81e65dfe3af82e3e2e09d596f8061149..86f1e6ddaaabf494137c736a1ceb1881f8800f2c 100644 (file)
@@ -952,7 +952,7 @@ func (cs *cstate) computeIntervals() {
                //
                // Note the SPanchored: this ensures that the scheduler won't
                // move the MOVDaddr earlier than the vardef. With a variable
-               // "xyz" that has no pointers, howver, if we start with
+               // "xyz" that has no pointers, however, if we start with
                //
                //    v66 = VarDef <mem> {t2} v65
                //    v67 = LocalAddr <*T> {t2} v2 v66
index b031e2a9ff8328336e6a44f4d3f9a0bbe1d2a446..044c18da65001bf8593104be8207fd81341e8216 100644 (file)
@@ -38,7 +38,7 @@
 // //line directives that change line numbers in strange ways should be rare,
 // and failing PGO matching on these files is not too big of a loss.
 
-// Package pgoir assosciates a PGO profile with the IR of the current package
+// Package pgoir associates a PGO profile with the IR of the current package
 // compilation.
 package pgoir
 
index 67479ace3b4fd3cbc19a13c00691e2d63c8b6e82..e2080324fe914f94d55ffea855d6464e61a11d64 100644 (file)
@@ -6424,7 +6424,7 @@ func genssa(f *ssa.Func, pp *objw.Progs) {
 
                if hotAlign > 0 && b.Hotness&ssa.HotPgoInitial == ssa.HotPgoInitial {
                        // So far this has only been shown profitable for PGO-hot loop headers.
-                       // The Hotness values allows distinctions betwen initial blocks that are "hot" or not, and "flow-in" or not.
+                       // The Hotness values allows distinctions between initial blocks that are "hot" or not, and "flow-in" or not.
                        // Currently only the initial blocks of loops are tagged in this way;
                        // there are no blocks tagged "pgo-hot" that are not also tagged "initial".
                        // TODO more heuristics, more architectures.
index 71d6032c07de1bd7101520b7b787d1e9cc120077..f78cf331987f0020e185ebbb71eefc9c3c65f823 100644 (file)
@@ -274,7 +274,7 @@ func (check *Checker) recordParenthesizedRecvTypes(expr syntax.Expr, typ Type) {
        }
 }
 
-// collectParams collects (but does not delare) all parameters of list and returns
+// collectParams collects (but does not declare) all parameters of list and returns
 // the list of parameter names, corresponding parameter variables, and whether the
 // parameter list is variadic. Anonymous parameters are recorded with nil names.
 func (check *Checker) collectParams(list []*syntax.Field, variadicOk bool) (names []*syntax.Name, params []*Var, variadic bool) {
index eeede6dad13da59a97a0ecc853301322cdd25be5..517d43548671857d3a45e7f9d3dd81ebf5948e3f 100644 (file)
@@ -51,7 +51,7 @@ module example.com/b
 
 go 1.23
 
-// The indrect comment below is inaccurate. Its purpose
+// The indirect comment below is inaccurate. Its purpose
 // is to test that it is corrected when enough packages
 // are loaded to correct it.
 
index 19a0effcd564854e6ff1d5ac9123b7777ef6003d..c46d31d2c291a6acd2672a808582907a68d6156c 100644 (file)
@@ -48,7 +48,7 @@ start:
 
 1. All generial-prupose register names are written as Rn.
 
-2. All floating-poing register names are written as Fn.
+2. All floating-point register names are written as Fn.
 
 # Argument mapping rules
 
index b2349a82cf13837532379dbce56530eb8972830d..9ade2348974dfcceef57d73a5a3cac538165d560 100644 (file)
@@ -411,7 +411,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
                                // The NOP is needed to give the jumps somewhere to land.
                                // It is a liblink NOP, not a hardware NOP: it encodes to 0 instruction bytes.
                                //
-                               // We don't generate this for leafs because that means the wrapped
+                               // We don't generate this for leaves because that means the wrapped
                                // function was inlined into the wrapper.
 
                                q = obj.Appendp(q, newprog)
index acccdee9062d4ebd0563c94e30aadf01687ce440..c2a088598546d130863f80d8bde7234d91dc2914 100644 (file)
@@ -595,7 +595,7 @@ func TestRelroSectionOverlapIssue67261(t *testing.T) {
                } else {
                        // Non-empty output indicates failure, as mentioned above.
                        if len(string(sout)) != 0 {
-                               t.Errorf("unexpected outut from %s:\n%s\n", sprog, string(sout))
+                               t.Errorf("unexpected output from %s:\n%s\n", sprog, string(sout))
                        }
                }
                rcmd := testenv.Command(t, filepath.Join(dir, targ))
index ade4c8fb281795d004a31bb0bb894aa85b6fc61e..6f69cabfd060d40b3a2c155548702342e7f77aa3 100644 (file)
@@ -176,7 +176,7 @@ func (h *huffmanEncoder) bitCounts(list []literalNode, maxBits int32) []int32 {
        for {
                l := &levels[level]
                if l.nextPairFreq == math.MaxInt32 && l.nextCharFreq == math.MaxInt32 {
-                       // We've run out of both leafs and pairs.
+                       // We've run out of both leaves and pairs.
                        // End all calculations for this level.
                        // To make sure we never come back to this level or any lower level,
                        // set nextPairFreq impossibly large.
index d2aa03ff789a2406a942b7a7016f3d87a004ae18..121b46aeca26201a80b3e00371de0f58c4f9438a 100644 (file)
@@ -302,7 +302,7 @@ func (check *Checker) recordParenthesizedRecvTypes(expr ast.Expr, typ Type) {
        }
 }
 
-// collectParams collects (but does not delare) all parameters of list and returns
+// collectParams collects (but does not declare) all parameters of list and returns
 // the list of parameter names, corresponding parameter variables, and whether the
 // parameter list is variadic. Anonymous parameters are recorded with nil names.
 func (check *Checker) collectParams(list *ast.FieldList, variadicOk bool) (names []*ast.Ident, params []*Var, variadic bool) {
index 4c80a7e5ec4fd7d17b84589449e1396b6f88a428..7d869e885fc2c91e1c9254b0f91a750bb051f588 100644 (file)
@@ -306,7 +306,7 @@ type StackFrame struct {
        Line uint64
 }
 
-// ExperimentalEvent presents a raw view of an experimental event's arguments and thier names.
+// ExperimentalEvent presents a raw view of an experimental event's arguments and their names.
 type ExperimentalEvent struct {
        // Name is the name of the event.
        Name string
index af2102b5b0a93453b5e4580d92cc0d6a87adaa7b..0365eeff70b0c8f46b6eb0ca16d56288c4abcd94 100644 (file)
@@ -385,10 +385,10 @@ func (p *parser) parseEventBatches() (Events, error) {
        // Merge events as long as at least one P has more events
        gs := make(map[uint64]gState)
        // Note: technically we don't need a priority queue here. We're only ever
-       // interested in the earliest elligible event, which means we just have to
+       // interested in the earliest eligible event, which means we just have to
        // track the smallest element. However, in practice, the priority queue
        // performs better, because for each event we only have to compute its state
-       // transition once, not on each iteration. If it was elligible before, it'll
+       // transition once, not on each iteration. If it was eligible before, it'll
        // already be in the queue. Furthermore, on average, we only have one P to
        // look at in each iteration, because all other Ps are already in the queue.
        var frontier orderEventList
index a14d376779ced6a21dead955e164f4c326e50c44..e5081598325c0668d1156b4ca7f096dab5ff422c 100644 (file)
@@ -4,7 +4,7 @@
 
 // Tests a G being created from within a syscall.
 //
-// Specifically, it tests a scenerio wherein a C
+// Specifically, it tests a scenario wherein a C
 // thread is calling into Go, creating a goroutine in
 // a syscall (in the tracer's model). The system is free
 // to reuse thread IDs, so first a thread ID is used to
index 1eb18026ecb3df26f43a8424104a5e51fd60f829..681464ce19d2f5198f38a1eaa743d0a8ee40e3f3 100644 (file)
@@ -4,7 +4,7 @@
 
 // Tests a G being created from within a syscall.
 //
-// Specifically, it tests a scenerio wherein a C
+// Specifically, it tests a scenario wherein a C
 // thread is calling into Go, creating a goroutine in
 // a syscall (in the tracer's model). Because the actual
 // m can be reused, it's possible for that m to have never
index 1f01cc9e78b21edf6f85b4b72c64455500bd408f..4e7296983309b806ad11edf4b6904f42deeb062e 100644 (file)
@@ -4,7 +4,7 @@
 
 // Tests syscall P stealing.
 //
-// Specifically, it tests a scenerio wherein, without a
+// Specifically, it tests a scenario wherein, without a
 // P sequence number of GoSyscallBegin, the syscall that
 // a ProcSteal applies to is ambiguous. This only happens in
 // practice when the events aren't already properly ordered
index 23b4539fcd6ca4d374b96f4d372b777cb09e8219..6f6e1c2202f42a4a22b366ca67975dc35d0fadac 100644 (file)
@@ -1109,7 +1109,7 @@ func TestDiv64PanicZero(t *testing.T) {
 }
 
 func TestRem32(t *testing.T) {
-       // Sanity check: for non-oveflowing dividends, the result is the
+       // Sanity check: for non-overflowing dividends, the result is the
        // same as the rem returned by Div32
        hi, lo, y := uint32(510510), uint32(9699690), uint32(510510+1) // ensure hi < y
        for i := 0; i < 1000; i++ {
@@ -1136,7 +1136,7 @@ func TestRem32Overflow(t *testing.T) {
 }
 
 func TestRem64(t *testing.T) {
-       // Sanity check: for non-oveflowing dividends, the result is the
+       // Sanity check: for non-overflowing dividends, the result is the
        // same as the rem returned by Div64
        hi, lo, y := uint64(510510), uint64(9699690), uint64(510510+1) // ensure hi < y
        for i := 0; i < 1000; i++ {
index 908f6322466b17705c418a57fe52b0bb511e5dd8..63ccbeb32841e2a48898cdcb5fe88f04942bf85b 100644 (file)
@@ -734,7 +734,7 @@ func BenchmarkMSpanCountAlloc(b *testing.B) {
        // always rounded up 8 bytes.
        for _, n := range []int{8, 16, 32, 64, 128} {
                b.Run(fmt.Sprintf("bits=%d", n*8), func(b *testing.B) {
-                       // Initialize a new byte slice with pseduo-random data.
+                       // Initialize a new byte slice with pseudo-random data.
                        bits := make([]byte, n)
                        rand.Read(bits)
 
index 2629c600fd3a25ff34ea5831acd74bf75ccb665f..1cd849f9aa809a48d2f073dbe546e1c085b537a0 100644 (file)
@@ -242,7 +242,7 @@ func newBucket(typ bucketType, nstk int) *bucket {
        return b
 }
 
-// stk returns the slice in b holding the stack. The caller can asssume that the
+// stk returns the slice in b holding the stack. The caller can assume that the
 // backing array is immutable.
 func (b *bucket) stk() []uintptr {
        stk := (*[maxProfStackDepth]uintptr)(add(unsafe.Pointer(b), unsafe.Sizeof(*b)))
index 6ce656c70e146e57f870e3227dc7c7a1862d31f2..3911276cf2c7f47f6fdef0cc6a65ed67844b7386 100644 (file)
@@ -636,7 +636,7 @@ func setThreadCPUProfiler(hz int32) {
        // spend shows up as a 10% chance of one sample (for an expected value of
        // 0.1 samples), and so that "two and six tenths" periods of CPU spend show
        // up as a 60% chance of 3 samples and a 40% chance of 2 samples (for an
-       // expected value of 2.6). Set the initial delay to a value in the unifom
+       // expected value of 2.6). Set the initial delay to a value in the uniform
        // random distribution between 0 and the desired period. And because "0"
        // means "disable timer", add 1 so the half-open interval [0,period) turns
        // into (0,period].
index cc809ac107e16c6cddfcb12ee1fe27e5343d5d68..cec5f28a08242a22555c4b6603d24a1801da29df 100644 (file)
@@ -590,13 +590,13 @@ var allocTests = []struct {
        argLen  int // The number of arguments to use for the syscall
        expected int // The expected number of allocations
 }{
-       // For less than or equal to 16 arguments, we expect 1 alloction:
+       // For less than or equal to 16 arguments, we expect 1 allocation:
        // - makeValue new(ref)
        {0,  1},
        {2,  1},
        {15, 1},
        {16, 1},
-       // For greater than 16 arguments, we expect 3 alloction:
+       // For greater than 16 arguments, we expect 3 allocation:
        // - makeValue: new(ref)
        // - makeArgSlices: argVals = make([]Value, size)
        // - makeArgSlices: argRefs = make([]ref, size)