Skip to content

Commit 54c948d

Browse files
Sajjongopherbot
authored andcommitted
src: fix typos
Fix typos in ~30 files Change-Id: Ie433aea01e7d15944c1e9e103691784876d5c1f9 GitHub-Last-Rev: bbaeb3d GitHub-Pull-Request: #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>
1 parent a4cb37d commit 54c948d

File tree

23 files changed

+30
-30
lines changed

23 files changed

+30
-30
lines changed

src/cmd/cgo/internal/testerrors/argposition_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ func (v *Visitor) Visit(node ast.Node) ast.Visitor {
4141
var errorMessage strings.Builder
4242
for caseIndex, expectedPos := range expectedPositions {
4343
actualPosition := v.fset.PositionFor(ident.Pos(), true)
44-
errorOccured := false
44+
errorOccurred := false
4545
if expectedPos.Line != actualPosition.Line {
4646
fmt.Fprintf(&errorMessage, "wrong line number for ident %s: expected: %d got: %d\n", ident.Name, expectedPos.Line, actualPosition.Line)
47-
errorOccured = true
47+
errorOccurred = true
4848
}
4949
if expectedPos.Column != actualPosition.Column {
5050
fmt.Fprintf(&errorMessage, "wrong column number for ident %s: expected: %d got: %d\n", ident.Name, expectedPos.Column, actualPosition.Column)
51-
errorOccured = true
51+
errorOccurred = true
5252
}
53-
if errorOccured {
53+
if errorOccurred {
5454
continue
5555
}
5656
gotMatch = true

src/cmd/compile/internal/inline/inl.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ func canInlineCallExpr(callerfn *ir.Func, n *ir.CallExpr, callee *ir.Func, bigCa
957957
}
958958

959959
if base.Debug.Checkptr != 0 && types.IsRuntimePkg(callee.Sym().Pkg) {
960-
// We don't intrument runtime packages for checkptr (see base/flag.go).
960+
// We don't instrument runtime packages for checkptr (see base/flag.go).
961961
if log && logopt.Enabled() {
962962
logopt.LogOpt(n.Pos(), "cannotInlineCall", "inline", ir.FuncName(callerfn),
963963
fmt.Sprintf(`call to into runtime package function %s in -d=checkptr build`, ir.PkgFuncName(callee)))

src/cmd/compile/internal/inline/inlheur/testdata/props/returns.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ func T_multi_return_nil(x, y bool) *Bar {
8888
return nil
8989
}
9090

91-
// returns.go T_multi_return_nil_anomoly 98 0 1
91+
// returns.go T_multi_return_nil_anomaly 98 0 1
9292
// ResultFlags
9393
// 0 ResultIsConcreteTypeConvertedToInterface
9494
// <endpropsdump>
9595
// {"Flags":0,"ParamFlags":[0,0],"ResultFlags":[4]}
9696
// <endcallsites>
9797
// <endfuncpreamble>
98-
func T_multi_return_nil_anomoly(x, y bool) Itf {
98+
func T_multi_return_nil_anomaly(x, y bool) Itf {
9999
if x && y {
100100
var qnil *Q
101101
return qnil

src/cmd/compile/internal/liveness/mergelocals.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ func (cs *cstate) computeIntervals() {
952952
//
953953
// Note the SPanchored: this ensures that the scheduler won't
954954
// move the MOVDaddr earlier than the vardef. With a variable
955-
// "xyz" that has no pointers, howver, if we start with
955+
// "xyz" that has no pointers, however, if we start with
956956
//
957957
// v66 = VarDef <mem> {t2} v65
958958
// v67 = LocalAddr <*T> {t2} v2 v66

src/cmd/compile/internal/pgoir/irgraph.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
// //line directives that change line numbers in strange ways should be rare,
3939
// and failing PGO matching on these files is not too big of a loss.
4040

41-
// Package pgoir assosciates a PGO profile with the IR of the current package
41+
// Package pgoir associates a PGO profile with the IR of the current package
4242
// compilation.
4343
package pgoir
4444

src/cmd/compile/internal/ssagen/ssa.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6424,7 +6424,7 @@ func genssa(f *ssa.Func, pp *objw.Progs) {
64246424

64256425
if hotAlign > 0 && b.Hotness&ssa.HotPgoInitial == ssa.HotPgoInitial {
64266426
// So far this has only been shown profitable for PGO-hot loop headers.
6427-
// The Hotness values allows distinctions betwen initial blocks that are "hot" or not, and "flow-in" or not.
6427+
// The Hotness values allows distinctions between initial blocks that are "hot" or not, and "flow-in" or not.
64286428
// Currently only the initial blocks of loops are tagged in this way;
64296429
// there are no blocks tagged "pgo-hot" that are not also tagged "initial".
64306430
// TODO more heuristics, more architectures.

src/cmd/compile/internal/types2/signature.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ func (check *Checker) recordParenthesizedRecvTypes(expr syntax.Expr, typ Type) {
274274
}
275275
}
276276

277-
// collectParams collects (but does not delare) all parameters of list and returns
277+
// collectParams collects (but does not declare) all parameters of list and returns
278278
// the list of parameter names, corresponding parameter variables, and whether the
279279
// parameter list is variadic. Anonymous parameters are recorded with nil names.
280280
func (check *Checker) collectParams(list []*syntax.Field, variadicOk bool) (names []*syntax.Name, params []*Var, variadic bool) {

src/cmd/go/testdata/script/mod_list_direct_work.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ module example.com/b
5151

5252
go 1.23
5353

54-
// The indrect comment below is inaccurate. Its purpose
54+
// The indirect comment below is inaccurate. Its purpose
5555
// is to test that it is corrected when enough packages
5656
// are loaded to correct it.
5757

src/cmd/internal/obj/loong64/doc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ start:
4848
4949
1. All generial-prupose register names are written as Rn.
5050
51-
2. All floating-poing register names are written as Fn.
51+
2. All floating-point register names are written as Fn.
5252
5353
# Argument mapping rules
5454

src/cmd/internal/obj/loong64/obj.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
411411
// The NOP is needed to give the jumps somewhere to land.
412412
// It is a liblink NOP, not a hardware NOP: it encodes to 0 instruction bytes.
413413
//
414-
// We don't generate this for leafs because that means the wrapped
414+
// We don't generate this for leaves because that means the wrapped
415415
// function was inlined into the wrapper.
416416

417417
q = obj.Appendp(q, newprog)

src/cmd/link/internal/ld/elf_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ func TestRelroSectionOverlapIssue67261(t *testing.T) {
595595
} else {
596596
// Non-empty output indicates failure, as mentioned above.
597597
if len(string(sout)) != 0 {
598-
t.Errorf("unexpected outut from %s:\n%s\n", sprog, string(sout))
598+
t.Errorf("unexpected output from %s:\n%s\n", sprog, string(sout))
599599
}
600600
}
601601
rcmd := testenv.Command(t, filepath.Join(dir, targ))

src/compress/flate/huffman_code.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func (h *huffmanEncoder) bitCounts(list []literalNode, maxBits int32) []int32 {
176176
for {
177177
l := &levels[level]
178178
if l.nextPairFreq == math.MaxInt32 && l.nextCharFreq == math.MaxInt32 {
179-
// We've run out of both leafs and pairs.
179+
// We've run out of both leaves and pairs.
180180
// End all calculations for this level.
181181
// To make sure we never come back to this level or any lower level,
182182
// set nextPairFreq impossibly large.

src/go/types/signature.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ func (check *Checker) recordParenthesizedRecvTypes(expr ast.Expr, typ Type) {
302302
}
303303
}
304304

305-
// collectParams collects (but does not delare) all parameters of list and returns
305+
// collectParams collects (but does not declare) all parameters of list and returns
306306
// the list of parameter names, corresponding parameter variables, and whether the
307307
// parameter list is variadic. Anonymous parameters are recorded with nil names.
308308
func (check *Checker) collectParams(list *ast.FieldList, variadicOk bool) (names []*ast.Ident, params []*Var, variadic bool) {

src/internal/trace/event.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ type StackFrame struct {
306306
Line uint64
307307
}
308308

309-
// ExperimentalEvent presents a raw view of an experimental event's arguments and thier names.
309+
// ExperimentalEvent presents a raw view of an experimental event's arguments and their names.
310310
type ExperimentalEvent struct {
311311
// Name is the name of the event.
312312
Name string

src/internal/trace/internal/oldtrace/parser.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,10 @@ func (p *parser) parseEventBatches() (Events, error) {
385385
// Merge events as long as at least one P has more events
386386
gs := make(map[uint64]gState)
387387
// Note: technically we don't need a priority queue here. We're only ever
388-
// interested in the earliest elligible event, which means we just have to
388+
// interested in the earliest eligible event, which means we just have to
389389
// track the smallest element. However, in practice, the priority queue
390390
// performs better, because for each event we only have to compute its state
391-
// transition once, not on each iteration. If it was elligible before, it'll
391+
// transition once, not on each iteration. If it was eligible before, it'll
392392
// already be in the queue. Furthermore, on average, we only have one P to
393393
// look at in each iteration, because all other Ps are already in the queue.
394394
var frontier orderEventList

src/internal/trace/testdata/generators/go122-create-syscall-reuse-thread-id.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Tests a G being created from within a syscall.
66
//
7-
// Specifically, it tests a scenerio wherein a C
7+
// Specifically, it tests a scenario wherein a C
88
// thread is calling into Go, creating a goroutine in
99
// a syscall (in the tracer's model). The system is free
1010
// to reuse thread IDs, so first a thread ID is used to

src/internal/trace/testdata/generators/go122-create-syscall-with-p.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Tests a G being created from within a syscall.
66
//
7-
// Specifically, it tests a scenerio wherein a C
7+
// Specifically, it tests a scenario wherein a C
88
// thread is calling into Go, creating a goroutine in
99
// a syscall (in the tracer's model). Because the actual
1010
// m can be reused, it's possible for that m to have never

src/internal/trace/testdata/generators/go122-syscall-steal-proc-ambiguous.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Tests syscall P stealing.
66
//
7-
// Specifically, it tests a scenerio wherein, without a
7+
// Specifically, it tests a scenario wherein, without a
88
// P sequence number of GoSyscallBegin, the syscall that
99
// a ProcSteal applies to is ambiguous. This only happens in
1010
// practice when the events aren't already properly ordered

src/math/bits/bits_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ func TestDiv64PanicZero(t *testing.T) {
11091109
}
11101110

11111111
func TestRem32(t *testing.T) {
1112-
// Sanity check: for non-oveflowing dividends, the result is the
1112+
// Sanity check: for non-overflowing dividends, the result is the
11131113
// same as the rem returned by Div32
11141114
hi, lo, y := uint32(510510), uint32(9699690), uint32(510510+1) // ensure hi < y
11151115
for i := 0; i < 1000; i++ {
@@ -1136,7 +1136,7 @@ func TestRem32Overflow(t *testing.T) {
11361136
}
11371137

11381138
func TestRem64(t *testing.T) {
1139-
// Sanity check: for non-oveflowing dividends, the result is the
1139+
// Sanity check: for non-overflowing dividends, the result is the
11401140
// same as the rem returned by Div64
11411141
hi, lo, y := uint64(510510), uint64(9699690), uint64(510510+1) // ensure hi < y
11421142
for i := 0; i < 1000; i++ {

src/runtime/gc_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ func BenchmarkMSpanCountAlloc(b *testing.B) {
734734
// always rounded up 8 bytes.
735735
for _, n := range []int{8, 16, 32, 64, 128} {
736736
b.Run(fmt.Sprintf("bits=%d", n*8), func(b *testing.B) {
737-
// Initialize a new byte slice with pseduo-random data.
737+
// Initialize a new byte slice with pseudo-random data.
738738
bits := make([]byte, n)
739739
rand.Read(bits)
740740

src/runtime/mprof.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func newBucket(typ bucketType, nstk int) *bucket {
242242
return b
243243
}
244244

245-
// stk returns the slice in b holding the stack. The caller can asssume that the
245+
// stk returns the slice in b holding the stack. The caller can assume that the
246246
// backing array is immutable.
247247
func (b *bucket) stk() []uintptr {
248248
stk := (*[maxProfStackDepth]uintptr)(add(unsafe.Pointer(b), unsafe.Sizeof(*b)))

src/runtime/os_linux.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ func setThreadCPUProfiler(hz int32) {
636636
// spend shows up as a 10% chance of one sample (for an expected value of
637637
// 0.1 samples), and so that "two and six tenths" periods of CPU spend show
638638
// up as a 60% chance of 3 samples and a 40% chance of 2 samples (for an
639-
// expected value of 2.6). Set the initial delay to a value in the unifom
639+
// expected value of 2.6). Set the initial delay to a value in the uniform
640640
// random distribution between 0 and the desired period. And because "0"
641641
// means "disable timer", add 1 so the half-open interval [0,period) turns
642642
// into (0,period].

src/syscall/js/js_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -590,13 +590,13 @@ var allocTests = []struct {
590590
argLen int // The number of arguments to use for the syscall
591591
expected int // The expected number of allocations
592592
}{
593-
// For less than or equal to 16 arguments, we expect 1 alloction:
593+
// For less than or equal to 16 arguments, we expect 1 allocation:
594594
// - makeValue new(ref)
595595
{0, 1},
596596
{2, 1},
597597
{15, 1},
598598
{16, 1},
599-
// For greater than 16 arguments, we expect 3 alloction:
599+
// For greater than 16 arguments, we expect 3 allocation:
600600
// - makeValue: new(ref)
601601
// - makeArgSlices: argVals = make([]Value, size)
602602
// - makeArgSlices: argRefs = make([]ref, size)

0 commit comments

Comments
 (0)