Skip to content

src: fix typos #68964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/cmd/cgo/internal/testerrors/argposition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/inline/inl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/liveness/mergelocals.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/pgoir/irgraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/ssagen/ssa.go
Original file line number Diff line number Diff line change
Expand Up @@ -7459,7 +7459,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.
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/types2/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/go/testdata/script/mod_list_direct_work.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/internal/obj/loong64/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/internal/obj/loong64/obj.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood if you prefer to revert this. I prefer to use correct English at all times, however, some people might find leafs more suitable in code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use Gerrit for comments and code review, but not GitHub.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://go.dev/doc/contribute has contribution instructions.

// function was inlined into the wrapper.

q = obj.Appendp(q, newprog)
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/link/internal/ld/elf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion src/compress/flate/huffman_code.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/go/types/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/internal/trace/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/internal/trace/internal/oldtrace/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/math/bits/bits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++ {
Expand All @@ -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++ {
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/gc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/mprof.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/os_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down
4 changes: 2 additions & 2 deletions src/syscall/js/js_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down