]> Cypherpunks repositories - gostls13.git/commitdiff
all: fix some function names and typos in comment
authorcuishuang <imcusg@gmail.com>
Wed, 20 Nov 2024 13:56:27 +0000 (21:56 +0800)
committerGopher Robot <gobot@golang.org>
Thu, 21 Nov 2024 22:16:20 +0000 (22:16 +0000)
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>

31 files changed:
src/cmd/compile/internal/ssa/_gen/PPC64Ops.go
src/cmd/compile/internal/ssa/_gen/genericOps.go
src/cmd/compile/internal/types2/README.md
src/cmd/compile/internal/walk/order.go
src/cmd/go/internal/generate/generate_test.go
src/cmd/go/internal/modload/edit.go
src/cmd/go/internal/mvs/mvs.go
src/cmd/go/main.go
src/cmd/internal/obj/ppc64/asm9.go
src/cmd/internal/obj/util.go
src/cmd/internal/objfile/disasm.go
src/cmd/internal/script/scripttest/conditions.go
src/cmd/link/link_test.go
src/crypto/tls/common.go
src/encoding/binary/binary.go
src/internal/pkgbits/decoder.go
src/internal/runtime/maps/table.go
src/internal/syscall/windows/version_windows.go
src/internal/trace/event/event.go
src/internal/types/testdata/check/go1_20_19.go
src/internal/types/testdata/check/go1_21_19.go
src/maps/maps_test.go
src/net/http/transport.go
src/runtime/debug/stack.go
src/runtime/export_test.go
src/runtime/mbarrier.go
src/runtime/panic.go
src/runtime/pprof/pprof_test.go
src/slices/slices_test.go
src/sort/example_keys_test.go
src/sort/example_multi_test.go

index f4212c15af7f0de2c86ef44bd13f44ab8f45fedd..1dae76366b7ec7ff30505ffea7b18e879d233c5f 100644 (file)
@@ -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)
 
index 0d136c2a986ca68d3a531b7822eebde75a7ed980..4dde6d51c5b22eeda72336603c08127cf07a2f91 100644 (file)
@@ -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.
index 5b913f917402cdb911f788b3afb3e97d2ecb7fb8..3d70cdbcf484ddf8ead23259c02f3b5c10de7db5 100644 (file)
@@ -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.
 
index 613edf497b1be0b3e251ef95e13f2489b396b1b6..858fc706ab9783045ba28e5f5d4db9b6594e2ad1 100644 (file)
@@ -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)
index d61ecf104a1ec569dc5143993552cbdd52eb788f..90e6a1f552873048e6275f04226db41bd4a5e978 100644 (file)
@@ -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},
index d7fa6d0564c793296b5374b6b88ec26f33d32a4a..b406193dc5a673466bb8ce826c3e1e185295e7fe 100644 (file)
@@ -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)
index b46c016c7809e9a4ca838015308b5b409446d530..50f8cb61ccdcfeba0951953184a3db6004a2c58c 100644 (file)
@@ -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.
index 4faeb8a17251fd5ce393295b96d94648fd9d2134..e81969ca4a3144801371d09edbe1c0629649e388 100644 (file)
@@ -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:]
index b30976c85df8d8cbad5dadd26a6f552659142e00..9cba8c33ced087156fc33b5927aa0a8b42b4df13 100644 (file)
@@ -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
        }
index dfbb636766a527b4f73935eef4467de9ca85f355..26de22122a626933967ddad74459fe4de97e91f2 100644 (file)
@@ -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 {
index 4334e88fad694d4390e343f342fd444f7a4ef8cd..99f54143fa986331e07749bbfc18d9623c78b625 100644 (file)
@@ -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 {
index 66dbfc2ac623a483f3d6018bc825ae8a70541512..e35ac2ddb7412fc748995caa90730eadc8a962f9 100644 (file)
@@ -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
index 62647e2ca3baebeed0aa3677b11bb8c22fa0ae22..f23951416ba8fd989649d4a6fba12e4e5ead45a4 100644 (file)
@@ -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")
                                }
index 662f1fc27a14412a502666ca7bb95f6cb35e11c4..1f73e50d24870b5816d481e367b71c19596424a8 100644 (file)
@@ -801,7 +801,7 @@ type Config struct {
        // be VersionTLS13.
        //
        // When EncryptedClientHelloConfigList is set, the handshake will only
-       // succeed if ECH is sucessfully negotiated. If the server rejects ECH,
+       // succeed if ECH is successfully negotiated. If the server rejects ECH,
        // an ECHRejectionError error will be returned, which may contain a new
        // ECHConfigList that the server suggests using.
        //
index a150c0bf05be47cc15be56ab8632c488f70db51d..d80aa8e11a5638cda8a756259b2d538f3b7db3c7 100644 (file)
@@ -448,7 +448,7 @@ func Encode(buf []byte, order ByteOrder, data any) (int, error) {
 // Append appends the binary representation of data to buf.
 // buf may be nil, in which case a new buffer will be allocated.
 // See [Write] on which data are acceptable.
-// It returns the (possibily extended) buffer containing data or an error.
+// It returns the (possibly extended) buffer containing data or an error.
 func Append(buf []byte, order ByteOrder, data any) ([]byte, error) {
        // Fast path for basic types and slices.
        if n, _ := intDataSize(data); n != 0 {
index 09f26a84bd4a3f8608911cdeaadcce0cc3fab777..5a2b3f4a6a31a12bfb71701487413641559412c1 100644 (file)
@@ -372,7 +372,7 @@ func (r *Decoder) Int64() int64 {
        return r.rawVarint()
 }
 
-// Int64 decodes and returns a uint64 value from the element bitstream.
+// Uint64 decodes and returns a uint64 value from the element bitstream.
 func (r *Decoder) Uint64() uint64 {
        r.Sync(SyncUint64)
        return r.rawUvarint()
index a4eb6695bc0f05d4f650590496ed6dda6ce8e9a4..cc39c24ab7b15a24458f487d41fd87a52c02e024 100644 (file)
@@ -549,7 +549,7 @@ func (it *Iter) Init(typ *abi.SwissMapType, m *Map) {
        dirIdx := 0
        var groupSmall groupReference
        if m.dirLen <= 0 {
-               // Use dirIdx == -1 as sentinal for small maps.
+               // Use dirIdx == -1 as sentinel for small maps.
                dirIdx = -1
                groupSmall.data = m.dirPtr
        }
@@ -598,7 +598,7 @@ func (it *Iter) nextDirIdx() {
        // - 2: *t2a
        // - 3: *t2b
        //
-       // At some point, the directory grew to accomodate a split of
+       // At some point, the directory grew to accommodate a split of
        // t2. t1 did not split, so entries 0 and 1 both point to t1.
        // t2 did split, so the two halves were installed in entries 2
        // and 3.
index 8f212728319fccf9458a8cc5e4713bb77c4957b6..cb5f6ba6cd30e4a18d53cb909852764b7fb9f81d 100644 (file)
@@ -59,7 +59,7 @@ var initTCPKeepAlive = sync.OnceFunc(func() {
        supportTCPKeepAliveCount = optSupported(TCP_KEEPCNT)
 })
 
-// SupportTCPKeepAliveInterval indicates whether TCP_KEEPIDLE is supported.
+// SupportTCPKeepAliveIdle indicates whether TCP_KEEPIDLE is supported.
 // The minimal requirement is Windows 10.0.16299.
 func SupportTCPKeepAliveIdle() bool {
        initTCPKeepAlive()
index 9a9bf74c6afe598a624b8103ba221c86e9dd47cc..b8b6af00533231d0935226501cf27e4db5fedb68 100644 (file)
@@ -20,7 +20,7 @@ type Spec struct {
        //
        // Argument names follow a certain structure and this structure
        // is relied on by the testing framework to type-check arguments.
-       // The structure is is:
+       // The structure is:
        //
        //     (?P<name>[A-Za-z]+_)?(?P<type>[A-Za-z]+)
        //
index e040d396c7808b93011a1d34f246be2a0f5be304..892179c72fc02f01da5d32a3d30fabf7f0903f86 100644 (file)
@@ -14,4 +14,4 @@ type Slice []byte
 type Array [8]byte
 
 var s Slice
-var p = (Array)(s /* ok because file versions below go1.21 set the langage version to go1.21 */)
+var p = (Array)(s /* ok because file versions below go1.21 set the language version to go1.21 */)
index 5866033eafe6f896e9132df6891a68a5bdc0cec0..febf653cb1b49cb96b9576c54921c402b913c9bf 100644 (file)
@@ -14,4 +14,4 @@ type Slice []byte
 type Array [8]byte
 
 var s Slice
-var p = (Array)(s /* ok because file versions below go1.21 set the langage version to go1.21 */)
+var p = (Array)(s /* ok because file versions below go1.21 set the language version to go1.21 */)
index fa30fe8c2bcb239a328a3c0adaa3e630fb9bffa9..c8ee3cd0311f5ffe98a693ccb849ec50974eb77b 100644 (file)
@@ -48,7 +48,7 @@ func equalNaN[T comparable](v1, v2 T) bool {
        return v1 == v2 || (isNaN(v1) && isNaN(v2))
 }
 
-// equalStr compares ints and strings.
+// equalIntStr compares ints and strings.
 func equalIntStr(v1 int, v2 string) bool {
        return strconv.Itoa(v1) == v2
 }
index a42533d2d51e317b749f6ad80723ce5f901a235b..c44d81e901289b463f4fddea04a03d20e822a269 100644 (file)
@@ -454,7 +454,7 @@ func (t *Transport) protocols() Protocols {
        p.SetHTTP1(true) // default always includes HTTP/1
        switch {
        case t.TLSNextProto != nil:
-               // Setting TLSNextProto to an empty map is is a documented way
+               // Setting TLSNextProto to an empty map is a documented way
                // to disable HTTP/2 on a Transport.
                if t.TLSNextProto["h2"] != nil {
                        p.SetHTTP2(true)
index d7a860b7dc941bceb2ac230c3b5bf51bed431586..c4c3be141c7b85e37dfdf47b6ed293c9a4f49dec 100644 (file)
@@ -52,7 +52,7 @@ func SetCrashOutput(f *os.File, opts CrashOptions) error {
                // The runtime will write to this file descriptor from
                // low-level routines during a panic, possibly without
                // a G, so we must call f.Fd() eagerly. This creates a
-               // danger that that the file descriptor is no longer
+               // danger that the file descriptor is no longer
                // valid at the time of the write, because the caller
                // (incorrectly) called f.Close() and the kernel
                // reissued the fd in a later call to open(2), leading
index 5153ae5f367fefa3b1761188b5a42997196f26f4..79d83b3a3b9de7feaa6f3b88ea7c7c49ba110428 100644 (file)
@@ -1264,7 +1264,7 @@ const (
 
 type TimeHistogram timeHistogram
 
-// Counts returns the counts for the given bucket, subBucket indices.
+// Count returns the counts for the given bucket, subBucket indices.
 // Returns true if the bucket was valid, otherwise returns the counts
 // for the overflow bucket if bucket > 0 or the underflow bucket if
 // bucket < 0, and false.
index 19006044ae34dd7fd2c434dd195c56a1f73f0ffa..a582a204b26b454c31eb5520cf1e21d4d2d98532 100644 (file)
@@ -368,7 +368,7 @@ func typedmemclr(typ *_type, ptr unsafe.Pointer) {
        memclrNoHeapPointers(ptr, typ.Size_)
 }
 
-// reflect_typedslicecopy is meant for package reflect,
+// reflect_typedmemclr is meant for package reflect,
 // but widely used packages access it using linkname.
 // Notable members of the hall of shame include:
 //   - github.com/ugorji/go/codec
index 58606e1dce42f4e2db982939e39e822004e2522e..dc7a7fe357e091390fd2964672a7fdf5abe648d6 100644 (file)
@@ -1155,7 +1155,7 @@ func recovery(gp *g) {
                // frames that we've already processed.
                //
                // There's a similar issue with nested panics, when the inner
-               // panic supercedes the outer panic. Again, we end up needing to
+               // panic supersedes the outer panic. Again, we end up needing to
                // walk the same stack frames.
                //
                // These are probably pretty rare occurrences in practice, and
index 78138b2f62dc81376cc54761e27de9b1e89dd082..bba66ba48fea352010124897c8dd237e1ce19e3c 100644 (file)
@@ -1229,7 +1229,7 @@ func blockFrequentShort(rate int) {
        }
 }
 
-// blockFrequentShort produces 10000 block events with an average duration of
+// blockInfrequentLong produces 10000 block events with an average duration of
 // rate.
 func blockInfrequentLong(rate int) {
        for i := 0; i < 10000; i++ {
index f830bb7fb54661b8676942f4f6d20d4aefc4e2d5..4ced7c07590bc666ba07f29b19915a7c18e5ae19 100644 (file)
@@ -1012,7 +1012,7 @@ func TestReverse(t *testing.T) {
        singleton := []string{"one"}
        Reverse(singleton)
        if want := []string{"one"}; !Equal(singleton, want) {
-               t.Errorf("Reverse(singeleton) = %v, want %v", singleton, want)
+               t.Errorf("Reverse(singleton) = %v, want %v", singleton, want)
        }
 
        Reverse[[]string](nil)
index 648f919e68dbd9d353d9fe2b52784b928ac8ec93..5e25f0d3eed9404472cf79afc470565ba643036d 100644 (file)
@@ -60,7 +60,7 @@ var planets = []Planet{
        {"Mars", 0.107, 1.5},
 }
 
-// ExampleSortKeys demonstrates a technique for sorting a struct type using programmable sort criteria.
+// Example_sortKeys demonstrates a technique for sorting a struct type using programmable sort criteria.
 func Example_sortKeys() {
        // Closures that order the Planet structure.
        name := func(p1, p2 *Planet) bool {
index 93f2d3ec5754a505d9bc6c8711175ffd0d9893f9..c21050b725d5ed04be7105cb060c0b6a7cc2c144 100644 (file)
@@ -87,7 +87,7 @@ var changes = []Change{
        {"gri", "Smalltalk", 80},
 }
 
-// ExampleMultiKeys demonstrates a technique for sorting a struct type using different
+// Example_sortMultiKeys demonstrates a technique for sorting a struct type using different
 // sets of multiple fields in the comparison. We chain together "Less" functions, each of
 // which compares a single field.
 func Example_sortMultiKeys() {