diff --git a/src/bytes/bytes_test.go b/src/bytes/bytes_test.go index da16882e82a5807f0d2cdc5ebf47278a8cddb305..ead581718ace8fb21fa06ea0b8e14739e84b7228 100644 --- a/src/bytes/bytes_test.go +++ b/src/bytes/bytes_test.go @@ -489,7 +489,7 @@ func TestIndexRune(t *testing.T) { {"a☺b☻c☹d\xe2\x98�\xff�\xed\xa0\x80", 0xD800, -1}, // Surrogate pair {"a☺b☻c☹d\xe2\x98�\xff�\xed\xa0\x80", utf8.MaxRune + 1, -1}, - // Test the cutover to to bytealg.Index when it is triggered in + // Test the cutover to bytealg.Index when it is triggered in // the middle of rune that contains consecutive runs of equal bytes. {"aaaaaKKKK\U000bc104", '\U000bc104', 17}, // cutover: (n + 16) / 8 {"aaaaaKKKK鄄", '鄄', 17}, diff --git a/src/cmd/compile/internal/devirtualize/devirtualize.go b/src/cmd/compile/internal/devirtualize/devirtualize.go index 5d1b9526271cb7f0a8ef9ff4fa0fa58825804b83..372d05809401ff590542f5c4dbfce70cdc5bdf20 100644 --- a/src/cmd/compile/internal/devirtualize/devirtualize.go +++ b/src/cmd/compile/internal/devirtualize/devirtualize.go @@ -63,7 +63,7 @@ func StaticCall(call *ir.CallExpr) { // dictionary parameter. We could devirtualize this call if we // could derive an appropriate dictionary argument. // - // TODO(mdempsky): If typ has has a promoted non-generic method, + // TODO(mdempsky): If typ has a promoted non-generic method, // then that method won't require a dictionary argument. We could // still devirtualize those calls. // diff --git a/src/cmd/compile/internal/devirtualize/pgo.go b/src/cmd/compile/internal/devirtualize/pgo.go index 783940cbc205a7daf1bf096c71c92611df9f7c0e..01677d82b687da0018b59f02a660e8dee05d9d7f 100644 --- a/src/cmd/compile/internal/devirtualize/pgo.go +++ b/src/cmd/compile/internal/devirtualize/pgo.go @@ -242,7 +242,7 @@ func maybeDevirtualizeFunctionCall(p *pgoir.Profile, fn *ir.Func, call *ir.CallE } // runtime.memhash_varlen does not look like a closure, but it uses // runtime.getclosureptr to access data encoded by callers, which are - // are generated by cmd/compile/internal/reflectdata.genhash. + // generated by cmd/compile/internal/reflectdata.genhash. if callee.Sym().Pkg.Path == "runtime" && callee.Sym().Name == "memhash_varlen" { if base.Debug.PGODebug >= 3 { fmt.Printf("callee %s is a closure (runtime.memhash_varlen), skipping\n", ir.FuncName(callee)) diff --git a/src/cmd/compile/internal/ir/reassignment.go b/src/cmd/compile/internal/ir/reassignment.go index 9974292471abda8780f1afeb5e74996fcf365843..ff54f708c22ae479e539d52d8de719ab50e47b1c 100644 --- a/src/cmd/compile/internal/ir/reassignment.go +++ b/src/cmd/compile/internal/ir/reassignment.go @@ -18,7 +18,7 @@ import ( // opposed to a new walk on every call). type ReassignOracle struct { fn *Func - // maps candidate name to its defining assignment (or for + // maps candidate name to its defining assignment (or // for params, defining func). singleDef map[*Name]Node } diff --git a/src/cmd/compile/internal/liveness/intervals.go b/src/cmd/compile/internal/liveness/intervals.go index 4757cca3ce9f46e9300fc2f657a0438237a82a5a..feca35b306d37ecee9f79b470b1f65b69a1a57ed 100644 --- a/src/cmd/compile/internal/liveness/intervals.go +++ b/src/cmd/compile/internal/liveness/intervals.go @@ -168,7 +168,7 @@ func (c *IntervalsBuilder) Live(pos int) error { } // Kill method should be invoked on instruction at position p if instr -// should be treated as as having a kill (lifetime end) for the +// should be treated as having a kill (lifetime end) for the // resource. See the example in the comment at the beginning of this // file for an example. Note that if we see a kill at position K for a // resource currently live since J, this will result in a lifetime diff --git a/src/cmd/compile/internal/liveness/mergelocals.go b/src/cmd/compile/internal/liveness/mergelocals.go index 017c4d1dbbb7e3675df0ec97d61354bd770526d0..f33ebd0d81e65dfe3af82e3e2e09d596f8061149 100644 --- a/src/cmd/compile/internal/liveness/mergelocals.go +++ b/src/cmd/compile/internal/liveness/mergelocals.go @@ -682,7 +682,7 @@ func nextRegion(cands []*ir.Name, idx int) int { // given subrange of cands described by st and en (indices into our // candidate var list), where the variables within this range have // already been determined to be compatible with respect to type, -// size, etc. Overlapping is done in a a greedy fashion: we select the +// size, etc. Overlapping is done in a greedy fashion: we select the // first element in the st->en range, then walk the rest of the // elements adding in vars whose lifetimes don't overlap with the // first element, then repeat the process until we run out of work. diff --git a/src/cmd/compile/internal/ssa/prove.go b/src/cmd/compile/internal/ssa/prove.go index 8acd38aa69f14c084ed9b0d8464b373e13f00def..87d83ba76281f59d32ded804e84b979c58eca328 100644 --- a/src/cmd/compile/internal/ssa/prove.go +++ b/src/cmd/compile/internal/ssa/prove.go @@ -618,7 +618,7 @@ func (ft *factsTable) newLimit(v *Value, newLim limit) bool { // extract relation between its args. For example, if // We learn v is false, and v is defined as a<b, then we learn a>=b. if v.Type.IsBoolean() { - // If we reach here, is is because we have a more restrictive + // If we reach here, it is because we have a more restrictive // value for v than the default. The only two such values // are constant true or constant false. if lim.min != lim.max { diff --git a/src/cmd/compile/internal/types2/signature.go b/src/cmd/compile/internal/types2/signature.go index 8754f5492ceb33d01fe61a6b3a4377e29ee2540b..71d6032c07de1bd7101520b7b787d1e9cc120077 100644 --- a/src/cmd/compile/internal/types2/signature.go +++ b/src/cmd/compile/internal/types2/signature.go @@ -134,7 +134,7 @@ func (check *Checker) funcType(sig *Signature, recvPar *syntax.Field, tparams [] } // collectRecv extracts the method receiver and its type parameters (if any) from rparam. -// It declares the type parameters (but not the receiver) in the the current scope, and +// It declares the type parameters (but not the receiver) in the current scope, and // returns the receiver variable and its type parameter list (if any). func (check *Checker) collectRecv(rparam *syntax.Field, scopePos syntax.Pos) (recv *Var, recvTParamsList *TypeParamList) { // Unpack the receiver parameter which is of the form diff --git a/src/cmd/compile/internal/types2/typeset.go b/src/cmd/compile/internal/types2/typeset.go index 9ea0a3e8f9ea28c5f95f9a4d86456328f3ea995b..2577631a53542546bd49638d7cab8342aae9d0d1 100644 --- a/src/cmd/compile/internal/types2/typeset.go +++ b/src/cmd/compile/internal/types2/typeset.go @@ -163,7 +163,7 @@ func computeInterfaceTypeSet(check *Checker, pos syntax.Pos, ityp *Interface) *_ // let any follow-on errors play out. // // TODO(gri) Consider recording when this happens and reporting - // it as an error (but only if there were no other errors so to + // it as an error (but only if there were no other errors so // to not have unnecessary follow-on errors). if !ityp.complete { return &topTypeSet diff --git a/src/cmd/go/internal/modcmd/download.go b/src/cmd/go/internal/modcmd/download.go index 373accef0679610cd064445706fa46ee8065f1c9..2f4feae8f254b2054ae16ca3b3a95ec2a9afb599 100644 --- a/src/cmd/go/internal/modcmd/download.go +++ b/src/cmd/go/internal/modcmd/download.go @@ -187,7 +187,7 @@ func runDownload(ctx context.Context, cmd *base.Command, args []string) { infos, infosErr := modload.ListModules(ctx, args, 0, *downloadReuse) // There is a bit of a chicken-and-egg problem here: ideally we need to know - // which Go version to switch to to download the requested modules, but if we + // which Go version to switch to download the requested modules, but if we // haven't downloaded the module's go.mod file yet the GoVersion field of its // info struct is not yet populated. // diff --git a/src/cmd/go/internal/modload/buildlist.go b/src/cmd/go/internal/modload/buildlist.go index e05585d7c42fe55a102493f1735ae66528403f08..9db348c0983e5a5b9bec5c5c6a39227ed99613a6 100644 --- a/src/cmd/go/internal/modload/buildlist.go +++ b/src/cmd/go/internal/modload/buildlist.go @@ -1222,7 +1222,7 @@ func updatePrunedRoots(ctx context.Context, direct map[string]bool, rs *Requirem return rs, nil } // The root set has converged: every root going into this iteration was - // already at its selected version, although we have have removed other + // already at its selected version, although we have removed other // (redundant) roots for the same path. break } @@ -1281,7 +1281,7 @@ func spotCheckRoots(ctx context.Context, rs *Requirements, mods map[module.Versi // module in direct as a root. func tidyUnprunedRoots(ctx context.Context, mainModule module.Version, old *Requirements, pkgs []*loadPkg) (*Requirements, error) { var ( - // keep is a set of of modules that provide packages or are needed to + // keep is a set of modules that provide packages or are needed to // disambiguate imports. keep []module.Version keptPath = map[string]bool{} diff --git a/src/cmd/go/internal/modload/edit.go b/src/cmd/go/internal/modload/edit.go index 5a5b8233c38713e1072840615613cb266aaceea5..d7fa6d0564c793296b5374b6b88ec26f33d32a4a 100644 --- a/src/cmd/go/internal/modload/edit.go +++ b/src/cmd/go/internal/modload/edit.go @@ -681,7 +681,7 @@ type dqTracker struct { // in the extended module graph. extendedRootPruning map[module.Version]modPruning - // dqReason records whether and why each each encountered version is + // dqReason records whether and why each encountered version is // disqualified in a pruned or unpruned context. dqReason map[module.Version]perPruning[dqState] diff --git a/src/cmd/internal/objabi/reloctype.go b/src/cmd/internal/objabi/reloctype.go index b7f0124c2a6bf784006cbab4189e21c92404f6e1..9106b085ea7d02cfee1880ad36642b40a697f78a 100644 --- a/src/cmd/internal/objabi/reloctype.go +++ b/src/cmd/internal/objabi/reloctype.go @@ -202,7 +202,7 @@ const ( // R_POWER_TLS marks an X-form instruction such as "ADD R3,R13,R4" as completing // a sequence of GOT-relative relocations to compute a TLS address. This can be - // used by the system linker to to rewrite the GOT-relative TLS relocation into a + // used by the system linker to rewrite the GOT-relative TLS relocation into a // simpler thread-pointer relative relocation. See table 3.26 and 3.28 in the // ppc64 elfv2 1.4 ABI on this transformation. Likewise, the second argument // (usually called RB in X-form instructions) is assumed to be R13. diff --git a/src/cmd/internal/testdir/testdir_test.go b/src/cmd/internal/testdir/testdir_test.go index 68fbdffb1dc5d4bdd337d64453e5ab1b3a7dae22..0810cef257da9cd7a6de32bf107c51c4b84ffee9 100644 --- a/src/cmd/internal/testdir/testdir_test.go +++ b/src/cmd/internal/testdir/testdir_test.go @@ -71,7 +71,7 @@ var ( // Test is the main entrypoint that runs tests in the GOROOT/test directory. // -// Each .go file test case in GOROOT/test is registered as a subtest with a +// Each .go file test case in GOROOT/test is registered as a subtest with // a full name like "Test/fixedbugs/bug000.go" ('/'-separated relative path). func Test(t *testing.T) { if *target != "" { diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index d66027387b97f86dbfd76bf7967eb3de25cbd138..39361aa815d19b0d8c6edf93d492972aac1db1ab 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -1275,7 +1275,7 @@ func hostlinksetup(ctxt *Link) { // cleanTimeStamps resets the timestamps for the specified list of // existing files to the Unix epoch (1970-01-01 00:00:00 +0000 UTC). // We take this step in order to help preserve reproducible builds; -// this seems to be primarily needed for external linking on on Darwin +// this seems to be primarily needed for external linking on Darwin // with later versions of xcode, which (unfortunately) seem to want to // incorporate object file times into the final output file's build // ID. See issue 64947 for the unpleasant details. diff --git a/src/go/token/position.go b/src/go/token/position.go index 04dbca7124355347a280131cff58ea40ed2646c5..4675e93703a2040ba030ee2c6d021fcd47dfcefa 100644 --- a/src/go/token/position.go +++ b/src/go/token/position.go @@ -306,7 +306,7 @@ func (f *File) Pos(offset int) Pos { // Offset returns the offset for the given file position p. // // If p is before the file's start position (or if p is NoPos), -// the result is 0; if p is past the file's end position, the +// the result is 0; if p is past the file's end position, // the result is the file size (see also go.dev/issue/57490). // // The following invariant, though not true for offset values diff --git a/src/go/types/signature.go b/src/go/types/signature.go index ea25ef49310efa0193fb8b96e6b79ba2a20a34ae..d2aa03ff789a2406a942b7a7016f3d87a004ae18 100644 --- a/src/go/types/signature.go +++ b/src/go/types/signature.go @@ -155,7 +155,7 @@ func (check *Checker) funcType(sig *Signature, recvPar *ast.FieldList, ftyp *ast } // collectRecv extracts the method receiver and its type parameters (if any) from rparam. -// It declares the type parameters (but not the receiver) in the the current scope, and +// It declares the type parameters (but not the receiver) in the current scope, and // returns the receiver variable and its type parameter list (if any). func (check *Checker) collectRecv(rparam *ast.Field, scopePos token.Pos) (recv *Var, recvTParamsList *TypeParamList) { // Unpack the receiver parameter which is of the form diff --git a/src/go/types/typeset.go b/src/go/types/typeset.go index 28f0a45468477061bed9b166fca55e783304fccb..5981c8ae62b36f1cf86e41ce742c0ed99c5012fc 100644 --- a/src/go/types/typeset.go +++ b/src/go/types/typeset.go @@ -166,7 +166,7 @@ func computeInterfaceTypeSet(check *Checker, pos token.Pos, ityp *Interface) *_T // let any follow-on errors play out. // // TODO(gri) Consider recording when this happens and reporting - // it as an error (but only if there were no other errors so to + // it as an error (but only if there were no other errors so // to not have unnecessary follow-on errors). if !ityp.complete { return &topTypeSet diff --git a/src/internal/trace/internal/oldtrace/parser.go b/src/internal/trace/internal/oldtrace/parser.go index afbf0ed50ed776e0e602cb1a102975fde66e25f7..af2102b5b0a93453b5e4580d92cc0d6a87adaa7b 100644 --- a/src/internal/trace/internal/oldtrace/parser.go +++ b/src/internal/trace/internal/oldtrace/parser.go @@ -813,7 +813,7 @@ func (p *parser) readRawEvent(flags uint, ev *rawEvent) error { } } -// loadBatch loads the next batch for pid and appends its contents to to events. +// loadBatch loads the next batch for pid and appends its contents to events. func (p *parser) loadBatch(pid int32, events []Event) ([]Event, error) { offsets := p.batchOffsets[pid] if len(offsets) == 0 { diff --git a/src/internal/trace/traceviewer/emitter.go b/src/internal/trace/traceviewer/emitter.go index c91c743a7bfb6c83141a576fe74724a61ef51b1c..c74f1c2ecf583d2d76555bb64c231453b4881b2b 100644 --- a/src/internal/trace/traceviewer/emitter.go +++ b/src/internal/trace/traceviewer/emitter.go @@ -614,7 +614,7 @@ func (e *Emitter) tsWithinRange(ts time.Duration) bool { return e.rangeStart <= ts && ts <= e.rangeEnd } -// OptionalEvent emits ev if it's within the time range of of the consumer, i.e. +// OptionalEvent emits ev if it's within the time range of the consumer, i.e. // the selected trace split range. func (e *Emitter) OptionalEvent(ev *format.Event) { e.c.ConsumeViewerEvent(ev, false) diff --git a/src/strings/strings_test.go b/src/strings/strings_test.go index 39f5f4e35579fb531337beb8939c9ca4dc9b0d18..806738066470198326f0c4ce2e805eb628f68e1a 100644 --- a/src/strings/strings_test.go +++ b/src/strings/strings_test.go @@ -356,7 +356,7 @@ func TestIndexRune(t *testing.T) { {Repeat("𡋀", 64) + "𡌀", '𡌀', 256}, // test cutover {Repeat("𡋀", 64), '𡌀', -1}, - // Test the cutover to to bytealg.IndexString when it is triggered in + // Test the cutover to bytealg.IndexString when it is triggered in // the middle of rune that contains consecutive runs of equal bytes. {"aaaaaKKKK\U000bc104", '\U000bc104', 17}, // cutover: (n + 16) / 8 {"aaaaaKKKK鄄", '鄄', 17}, diff --git a/src/syscall/syscall_wasip1.go b/src/syscall/syscall_wasip1.go index 84c6bddc0897df499e7f4e0c3119174a4748ad52..bcf7676123c06c79c162b02ffbe89afa5da1b4fa 100644 --- a/src/syscall/syscall_wasip1.go +++ b/src/syscall/syscall_wasip1.go @@ -307,7 +307,7 @@ func (w WaitStatus) TrapCause() int { return 0 } // Rusage is a placeholder to allow compilation of the [os/exec] package // because we need Go programs to be portable across platforms. WASI does -// not have a mechanism to to spawn processes so there is no reason for an +// not have a mechanism to spawn processes so there is no reason for an // application to take a dependency on this type. type Rusage struct { Utime Timeval @@ -316,7 +316,7 @@ type Rusage struct { // ProcAttr is a placeholder to allow compilation of the [os/exec] package // because we need Go programs to be portable across platforms. WASI does -// not have a mechanism to to spawn processes so there is no reason for an +// not have a mechanism to spawn processes so there is no reason for an // application to take a dependency on this type. type ProcAttr struct { Dir string