aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorcuishuang <imcusg@gmail.com>2024-11-20 21:56:27 +0800
committerGopher Robot <gobot@golang.org>2024-11-21 22:16:20 +0000
commita925402b62c06d1cfe2b345cba0b11fa06b8401d (patch)
tree3d91369411c3148ade70b21da8d01f7f0dcec655 /src/cmd
parent154fb4e1d45e503658542dee5296243a6146e7ca (diff)
downloadgo-a925402b62c06d1cfe2b345cba0b11fa06b8401d.tar.xz
all: fix some function names and typos in comment
Change-Id: I07e7c8eaa5bd4bac0d576b2f2f4cd3f81b0b77a4 Reviewed-on: https://go-review.googlesource.com/c/go/+/630055 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Commit-Queue: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Russ Cox <rsc@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/compile/internal/ssa/_gen/PPC64Ops.go2
-rw-r--r--src/cmd/compile/internal/ssa/_gen/genericOps.go2
-rw-r--r--src/cmd/compile/internal/types2/README.md4
-rw-r--r--src/cmd/compile/internal/walk/order.go4
-rw-r--r--src/cmd/go/internal/generate/generate_test.go2
-rw-r--r--src/cmd/go/internal/modload/edit.go2
-rw-r--r--src/cmd/go/internal/mvs/mvs.go2
-rw-r--r--src/cmd/go/main.go2
-rw-r--r--src/cmd/internal/obj/ppc64/asm9.go2
-rw-r--r--src/cmd/internal/obj/util.go2
-rw-r--r--src/cmd/internal/objfile/disasm.go2
-rw-r--r--src/cmd/internal/script/scripttest/conditions.go2
-rw-r--r--src/cmd/link/link_test.go2
13 files changed, 15 insertions, 15 deletions
diff --git a/src/cmd/compile/internal/ssa/_gen/PPC64Ops.go b/src/cmd/compile/internal/ssa/_gen/PPC64Ops.go
index f4212c15af..1dae76366b 100644
--- a/src/cmd/compile/internal/ssa/_gen/PPC64Ops.go
+++ b/src/cmd/compile/internal/ssa/_gen/PPC64Ops.go
@@ -290,7 +290,7 @@ func init() {
// Movement between float and integer registers with no change in bits; accomplished with stores+loads on PPC.
// Because the 32-bit load-literal-bits instructions have impoverished addressability, always widen the
- // data instead and use FMOVDload and FMOVDstore instead (this will also dodge endianess issues).
+ // data instead and use FMOVDload and FMOVDstore instead (this will also dodge endianness issues).
// There are optimizations that should apply -- (Xi2f64 (MOVWload (not-ADD-ptr+offset) ) ) could use
// the word-load instructions. (Xi2f64 (MOVDload ptr )) can be (FMOVDload ptr)
diff --git a/src/cmd/compile/internal/ssa/_gen/genericOps.go b/src/cmd/compile/internal/ssa/_gen/genericOps.go
index 0d136c2a98..4dde6d51c5 100644
--- a/src/cmd/compile/internal/ssa/_gen/genericOps.go
+++ b/src/cmd/compile/internal/ssa/_gen/genericOps.go
@@ -632,7 +632,7 @@ var genericOps = []opData{
// These variants have the same semantics as above atomic operations.
// But they are used for generating more efficient code on certain modern machines, with run-time CPU feature detection.
// On ARM64, these are used when the LSE hardware feature is available (either known at compile time or detected at runtime). If LSE is not available,
- // then the basic atomic oprations are used instead.
+ // then the basic atomic operations are used instead.
{name: "AtomicStore8Variant", argLength: 3, typ: "Mem", hasSideEffects: true}, // Store arg1 to *arg0. arg2=memory. Returns memory.
{name: "AtomicStore32Variant", argLength: 3, typ: "Mem", hasSideEffects: true}, // Store arg1 to *arg0. arg2=memory. Returns memory.
{name: "AtomicStore64Variant", argLength: 3, typ: "Mem", hasSideEffects: true}, // Store arg1 to *arg0. arg2=memory. Returns memory.
diff --git a/src/cmd/compile/internal/types2/README.md b/src/cmd/compile/internal/types2/README.md
index 5b913f9174..3d70cdbcf4 100644
--- a/src/cmd/compile/internal/types2/README.md
+++ b/src/cmd/compile/internal/types2/README.md
@@ -32,7 +32,7 @@ This is done via a generator (go/types/generate_test.go) which may be invoked vi
`go generate` in the go/types directory.
Generated files are clearly marked with a comment at the top and should not
be modified by hand.
-For this reason, it is usally best to make changes to the types2 sources first.
+For this reason, it is usually best to make changes to the types2 sources first.
The changes only need to be ported by hand for the go/types files that cannot
be generated yet.
@@ -129,7 +129,7 @@ func (check *Checker) f(x *operand, e syntax.Expr, /* addition arguments, if any
```
The result of typechecking expression `e` is returned via the operand `x`
(which sometimes also serves as incoming argument).
-If an error occured the function f will report the error and try to continue
+If an error occurred the function f will report the error and try to continue
as best as it can, but it may return an invalid operand (`x.mode == invalid`).
Callers may need to explicitly check for invalid operands.
diff --git a/src/cmd/compile/internal/walk/order.go b/src/cmd/compile/internal/walk/order.go
index 613edf497b..858fc706ab 100644
--- a/src/cmd/compile/internal/walk/order.go
+++ b/src/cmd/compile/internal/walk/order.go
@@ -453,7 +453,7 @@ func (o *orderState) edge() {
// never 0.
// Another policy presented in the paper is the Saturated Counters policy which
// freezes the counter when it reaches the value of 255. However, a range
- // of experiments showed that that decreases overall performance.
+ // of experiments showed that doing so decreases overall performance.
o.append(ir.NewIfStmt(base.Pos,
ir.NewBinaryExpr(base.Pos, ir.OEQ, counter, ir.NewInt(base.Pos, 0xff)),
[]ir.Node{ir.NewAssignStmt(base.Pos, counter, ir.NewInt(base.Pos, 1))},
@@ -1219,7 +1219,7 @@ func (o *orderState) expr1(n, lhs ir.Node) ir.Node {
}
}
- // key may need to be be addressable
+ // key may need to be addressable
n.Index = o.mapKeyTemp(n.Pos(), n.X.Type(), n.Index)
if needCopy {
return o.copyExpr(n)
diff --git a/src/cmd/go/internal/generate/generate_test.go b/src/cmd/go/internal/generate/generate_test.go
index d61ecf104a..90e6a1f552 100644
--- a/src/cmd/go/internal/generate/generate_test.go
+++ b/src/cmd/go/internal/generate/generate_test.go
@@ -208,7 +208,7 @@ func TestGenerateCommandShorthand(t *testing.T) {
}
// Command-related tests for TestGenerateCommandShortHand2
-// -- Note line numbers included to check substitutions from "build-in" variable - $GOLINE
+// -- Note line numbers included to check substitutions from "built-in" variable - $GOLINE
var splitTestsLines = []splitTestWithLine{
{"-command TEST1 $GOLINE", []string{"-command", "TEST1", "22"}, 22},
{"-command TEST2 ${DOLLAR}GOLINE", []string{"-command", "TEST2", "$GOLINE"}, 26},
diff --git a/src/cmd/go/internal/modload/edit.go b/src/cmd/go/internal/modload/edit.go
index d7fa6d0564..b406193dc5 100644
--- a/src/cmd/go/internal/modload/edit.go
+++ b/src/cmd/go/internal/modload/edit.go
@@ -749,7 +749,7 @@ func (t *dqTracker) require(m, r module.Version) (ok bool) {
}
}
- // Record that m is a dependant of r, so that if r is later disqualified
+ // Record that m is a dependent of r, so that if r is later disqualified
// m will be disqualified as well.
if t.requiring == nil {
t.requiring = make(map[module.Version][]module.Version)
diff --git a/src/cmd/go/internal/mvs/mvs.go b/src/cmd/go/internal/mvs/mvs.go
index b46c016c78..50f8cb61cc 100644
--- a/src/cmd/go/internal/mvs/mvs.go
+++ b/src/cmd/go/internal/mvs/mvs.go
@@ -438,7 +438,7 @@ List:
// requirements of other modules.
//
// If one of those requirements pulls the version back up above the version
- // identified by reqs.Previous, then the transitive dependencies of that that
+ // identified by reqs.Previous, then the transitive dependencies of that
// initially-downgraded version should no longer matter — in particular, we
// should not add new dependencies on module paths that nothing else in the
// updated module graph even requires.
diff --git a/src/cmd/go/main.go b/src/cmd/go/main.go
index 4faeb8a172..e81969ca4a 100644
--- a/src/cmd/go/main.go
+++ b/src/cmd/go/main.go
@@ -221,7 +221,7 @@ func main() {
base.Exit()
}
-// cmdIsGoTelemeteryOff reports whether the command is "go telemetry off". This
+// cmdIsGoTelemetryOff reports whether the command is "go telemetry off". This
// is used to decide whether to disable the opening of counter files. See #69269.
func cmdIsGoTelemetryOff() bool {
restArgs := os.Args[1:]
diff --git a/src/cmd/internal/obj/ppc64/asm9.go b/src/cmd/internal/obj/ppc64/asm9.go
index b30976c85d..9cba8c33ce 100644
--- a/src/cmd/internal/obj/ppc64/asm9.go
+++ b/src/cmd/internal/obj/ppc64/asm9.go
@@ -2520,7 +2520,7 @@ func decodeMask64(mask int64) (mb, me uint32, valid bool) {
func loadl16(r int, d int64) uint32 {
v := uint16(d)
if v == 0 {
- // Avoid generating "ori r,r,0", r != 0. Instead, generate the architectually preferred nop.
+ // Avoid generating "ori r,r,0", r != 0. Instead, generate the architecturally preferred nop.
// For example, "ori r31,r31,0" is a special execution serializing nop on Power10 called "exser".
return NOP
}
diff --git a/src/cmd/internal/obj/util.go b/src/cmd/internal/obj/util.go
index dfbb636766..26de22122a 100644
--- a/src/cmd/internal/obj/util.go
+++ b/src/cmd/internal/obj/util.go
@@ -717,7 +717,7 @@ func AlignmentPaddingLength(pc int32, p *Prog, ctxt *Link) int {
// emit as many as s bytes of padding to obtain alignment
s := p.To.Offset
if s < 0 || s >= a {
- ctxt.Diag("PCALIGNMAX 'amount' %d must be non-negative and smaller than the aligment %d\n", s, a)
+ ctxt.Diag("PCALIGNMAX 'amount' %d must be non-negative and smaller than the alignment %d\n", s, a)
return 0
}
if s >= a-lob {
diff --git a/src/cmd/internal/objfile/disasm.go b/src/cmd/internal/objfile/disasm.go
index 4334e88fad..99f54143fa 100644
--- a/src/cmd/internal/objfile/disasm.go
+++ b/src/cmd/internal/objfile/disasm.go
@@ -188,7 +188,7 @@ func (fc *FileCache) Line(filename string, line int) ([]byte, error) {
// Print prints a disassembly of the file to w.
// If filter is non-nil, the disassembly only includes functions with names matching filter.
-// If printCode is true, the disassembly includs corresponding source lines.
+// If printCode is true, the disassembly includes corresponding source lines.
// The disassembly only includes functions that overlap the range [start, end).
func (d *Disasm) Print(w io.Writer, filter *regexp.Regexp, start, end uint64, printCode bool, gnuAsm bool) {
if start < d.textStart {
diff --git a/src/cmd/internal/script/scripttest/conditions.go b/src/cmd/internal/script/scripttest/conditions.go
index 66dbfc2ac6..e35ac2ddb7 100644
--- a/src/cmd/internal/script/scripttest/conditions.go
+++ b/src/cmd/internal/script/scripttest/conditions.go
@@ -15,7 +15,7 @@ import (
"testing"
)
-// AddToolChainConditions accepts a script.Cond map and adds into it a
+// AddToolChainScriptConditions accepts a [script.Cond] map and adds into it a
// set of commonly used conditions for doing toolchains testing,
// including whether the platform supports cgo, a buildmode condition,
// support for GOEXPERIMENT testing, etc. Callers must also pass in
diff --git a/src/cmd/link/link_test.go b/src/cmd/link/link_test.go
index 62647e2ca3..f23951416b 100644
--- a/src/cmd/link/link_test.go
+++ b/src/cmd/link/link_test.go
@@ -468,7 +468,7 @@ func TestMachOUUID(t *testing.T) {
uuid := extractUUID(exe)
if test.expect == "gobuildid" {
// Go buildid is not known in source code. Check UUID is present,
- // and satisifies UUIDv3.
+ // and satisfies UUIDv3.
if uuid == "" {
t.Fatal("expect nonempty UUID, got empty")
}