]> Cypherpunks repositories - gostls13.git/commitdiff
all: fix a lot of comments
authorcui fliter <imcusg@gmail.com>
Fri, 5 May 2023 16:11:33 +0000 (00:11 +0800)
committerGopher Robot <gobot@golang.org>
Wed, 10 May 2023 12:59:20 +0000 (12:59 +0000)
Fix comments, including duplicate is, wrong phrases and articles, misspellings, etc.

Change-Id: I8bfea53b9b275e649757cc4bee6a8a026ed9c7a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/493035
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: shuang cui <imcusg@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

20 files changed:
src/cmd/compile/internal/loopvar/loopvar.go
src/cmd/compile/internal/ssa/value.go
src/cmd/compile/internal/ssagen/ssa.go
src/cmd/compile/internal/types2/infer.go
src/cmd/compile/internal/types2/resolver_test.go
src/cmd/compile/internal/types2/unify.go
src/cmd/compile/internal/walk/expr.go
src/go/scanner/scanner_test.go
src/go/types/eval.go
src/go/types/infer.go
src/go/types/unify.go
src/internal/types/testdata/check/errors.go
src/math/big/floatconv.go
src/net/http/cookiejar/jar_test.go
src/net/http/request_test.go
src/net/http/transport_test.go
src/runtime/runtime-gdb.py
src/runtime/runtime2.go
src/sync/atomic/type.go
src/syscall/fs_wasip1.go

index 7752cac53505849debb8c3a6692393475a96edca..ccb14df80b7263211c7b455ed342c3a0c110d5ce 100644 (file)
@@ -443,7 +443,7 @@ func ForCapture(fn *ir.Func) []VarAndLoop {
        return transformed
 }
 
-// forAllDefInInitUpdate applies "do" to all the defining assignemnts in the Init clause of a ForStmt.
+// forAllDefInInitUpdate applies "do" to all the defining assignments in the Init clause of a ForStmt.
 // This abstracts away some of the boilerplate from the already complex and verbose for-3-clause case.
 func forAllDefInInitUpdate(x *ir.ForStmt, do func(z ir.Node, update *ir.Node)) {
        for _, s := range x.Init() {
index 6b0367a3dc61be591a1f956bdf449088279f021b..e89024b3c665db14139a1f433cb739155a51de4a 100644 (file)
@@ -86,7 +86,7 @@ func (v *Value) AuxInt8() int8 {
 
 func (v *Value) AuxUInt8() uint8 {
        if opcodeTable[v.Op].auxType != auxUInt8 {
-               v.Fatalf("op %s doesn't have an uint8 aux field", v.Op)
+               v.Fatalf("op %s doesn't have a uint8 aux field", v.Op)
        }
        return uint8(v.AuxInt)
 }
index a037b7494d517d7e8c200c92ca0dcef386ce54f2..9248424b08d320c694018c32cfd0f160e795744c 100644 (file)
@@ -718,7 +718,7 @@ func (s *state) checkPtrAlignment(n *ir.ConvExpr, v *ssa.Value, count *ssa.Value
                count = s.constInt(types.Types[types.TUINTPTR], 1)
        }
        if count.Type.Size() != s.config.PtrSize {
-               s.Fatalf("expected count fit to an uintptr size, have: %d, want: %d", count.Type.Size(), s.config.PtrSize)
+               s.Fatalf("expected count fit to a uintptr size, have: %d, want: %d", count.Type.Size(), s.config.PtrSize)
        }
        var rtype *ssa.Value
        if rtypeExpr != nil {
index 0f4fc6d4b462adbd7af19adf26cf2c3b8e6c7d14..94a59f94bbf777dc2305e1ac8cb9b6ef18fef390 100644 (file)
@@ -576,7 +576,7 @@ func (w *tpWalker) isParameterized(typ Type) (res bool) {
                // of a generic function type (or an interface method) that is
                // part of the type we're testing. We don't care about these type
                // parameters.
-               // Similarly, the receiver of a method may declare (rather then
+               // Similarly, the receiver of a method may declare (rather than
                // use) type parameters, we don't care about those either.
                // Thus, we only need to look at the input and result parameters.
                return t.params != nil && w.varList(t.params.vars) || t.results != nil && w.varList(t.results.vars)
index 923712b2687612d53355c23e870f1df30ea12caa..8105d8af42cdaef4aae001b9295ba9c460c8263e 100644 (file)
@@ -166,7 +166,7 @@ func TestResolveIdents(t *testing.T) {
        }
 
        // Check that each identifier in the source is found in uses or defs or both.
-       // We need the foundUses/Defs maps (rather then just deleting the found objects
+       // We need the foundUses/Defs maps (rather than just deleting the found objects
        // from the uses and defs maps) because syntax.Walk traverses shared nodes multiple
        // times (e.g. types in field lists such as "a, b, c int").
        foundUses := make(map[*syntax.Name]bool)
index 3c4027d1899c20b48f43a7392de17f468d343006..c02d56a7e1ec55873999f7589912105fded9d475 100644 (file)
@@ -277,7 +277,7 @@ func (u *unifier) nify(x, y Type, p *ifacePair) (result bool) {
        // Unification will fail if we match a defined type against a type literal.
        // Per the (spec) assignment rules, assignments of values to variables with
        // the same type structure are permitted as long as at least one of them
-       // is not a defined type. To accomodate for that possibility, we continue
+       // is not a defined type. To accommodate for that possibility, we continue
        // unification with the underlying type of a defined type if the other type
        // is a type literal.
        // We also continue if the other type is a basic type because basic types
index 72f783234689e549f4b0517f958e595cd6a3f8f3..fe678125804f404ef7e887ff3d12b1a280b3795f 100644 (file)
@@ -759,7 +759,7 @@ func walkIndex(n *ir.IndexExpr, init *ir.Nodes) ir.Node {
 
 // mapKeyArg returns an expression for key that is suitable to be passed
 // as the key argument for runtime map* functions.
-// n is is the map indexing or delete Node (to provide Pos).
+// n is the map indexing or delete Node (to provide Pos).
 func mapKeyArg(fast int, n, key ir.Node, assigned bool) ir.Node {
        if fast == mapslow {
                // standard version takes key by reference.
index 4f320ee9f7ac22f8339e697e528e19e32a8bc577..9046148ac2c4a05127bbdeb079c9900826d34612 100644 (file)
@@ -351,7 +351,7 @@ func checkSemi(t *testing.T, input, want string, mode Mode) {
                        break
                }
                if tok == token.SEMICOLON && lit != ";" {
-                       // Artifical semicolon:
+                       // Artificial semicolon:
                        // assert that position is EOF or that of a newline.
                        off := file.Offset(pos)
                        if off != len(input) && input[off] != '\n' {
index 1655a8bd2737d51b86c143f047222864e93270c3..ff2af58b309268073aaed2c1f748b8ef07c10a18 100644 (file)
@@ -52,7 +52,7 @@ func Eval(fset *token.FileSet, pkg *Package, pos token.Pos, expr string) (_ Type
 // to compute types and values, but in addition to Check, as these
 // functions ignore the context in which an expression is used (e.g., an
 // assignment). Thus, top-level untyped constants will return an
-// untyped type rather then the respective context-specific type.
+// untyped type rather than the respective context-specific type.
 func CheckExpr(fset *token.FileSet, pkg *Package, pos token.Pos, expr ast.Expr, info *Info) (err error) {
        // determine scope
        var scope *Scope
index e40b9921a49228176a39099126fe7664e3936d96..661ff771c838e03fb81a5e2d3f87ae5b57aa4191 100644 (file)
@@ -578,7 +578,7 @@ func (w *tpWalker) isParameterized(typ Type) (res bool) {
                // of a generic function type (or an interface method) that is
                // part of the type we're testing. We don't care about these type
                // parameters.
-               // Similarly, the receiver of a method may declare (rather then
+               // Similarly, the receiver of a method may declare (rather than
                // use) type parameters, we don't care about those either.
                // Thus, we only need to look at the input and result parameters.
                return t.params != nil && w.varList(t.params.vars) || t.results != nil && w.varList(t.results.vars)
index 9d89a687de27d461549da6ff01674b0adc0ddb60..34455ac40f4490c6036936420e8b1ccf366433be 100644 (file)
@@ -279,7 +279,7 @@ func (u *unifier) nify(x, y Type, p *ifacePair) (result bool) {
        // Unification will fail if we match a defined type against a type literal.
        // Per the (spec) assignment rules, assignments of values to variables with
        // the same type structure are permitted as long as at least one of them
-       // is not a defined type. To accomodate for that possibility, we continue
+       // is not a defined type. To accommodate for that possibility, we continue
        // unification with the underlying type of a defined type if the other type
        // is a type literal.
        // We also continue if the other type is a basic type because basic types
index d9d22ac2b499e263533565317b673be2a3b1c784..10b6a22eb1b880fcdaf5b349999ab56ffd44d08d 100644 (file)
@@ -58,7 +58,7 @@ func _() {
 
 // Use unqualified names for package-local objects.
 type T struct{}
-var _ int = T /* ERROR "value of type T" */ {} // use T in error message rather then errors.T
+var _ int = T /* ERROR "value of type T" */ {} // use T in error message rather than errors.T
 
 // Don't report errors containing "invalid type" (issue #24182).
 func _(x *missing /* ERROR "undefined: missing" */ ) {
index 3bb51c7dea862232ac3dc3be16a0722f91abc826..6501185fbed3df6996fa830037f7eeb08059ffd4 100644 (file)
@@ -248,7 +248,7 @@ func (z *Float) pow5(n uint64) *Float {
 // no prefix is accepted. The octal prefix "0" is not supported (a leading
 // "0" is simply considered a "0").
 //
-// A "p" or "P" exponent indicates a base 2 (rather then base 10) exponent;
+// A "p" or "P" exponent indicates a base 2 (rather than base 10) exponent;
 // for instance, "0x1.fffffffffffffp1023" (using base 0) represents the
 // maximum float64 value. For hexadecimal mantissae, the exponent character
 // must be one of 'p' or 'P', if present (an "e" or "E" exponent indicator
index 13d994aa39347842fc1a197471e1b3d385dba420..56d0695a660c07415a6f7cdd68993428719e06ae 100644 (file)
@@ -349,7 +349,7 @@ func expiresIn(delta int) string {
        return "expires=" + t.Format(time.RFC1123)
 }
 
-// mustParseURL parses s to an URL and panics on error.
+// mustParseURL parses s to a URL and panics on error.
 func mustParseURL(s string) *url.URL {
        u, err := url.Parse(s)
        if err != nil || u.Scheme == "" || u.Host == "" {
@@ -670,7 +670,7 @@ var updateAndDeleteTests = [...]jarTest{
                },
        },
        {
-               "Clear Secure flag from a http.",
+               "Clear Secure flag from an http.",
                "http://www.host.test/",
                []string{
                        "b=xx",
index 23e49d6b8e3549b1f8d46598567f1cc87f93352a..76c8790f1675bf229026bbb42ec9d006e6984b72 100644 (file)
@@ -31,7 +31,7 @@ func TestQuery(t *testing.T) {
        }
 }
 
-// Issue #25192: Test that ParseForm fails but still parses the form when an URL
+// Issue #25192: Test that ParseForm fails but still parses the form when a URL
 // containing a semicolon is provided.
 func TestParseFormSemicolonSeparator(t *testing.T) {
        for _, method := range []string{"POST", "PATCH", "PUT", "GET"} {
@@ -379,7 +379,7 @@ func TestMultipartRequest(t *testing.T) {
 }
 
 // Issue #25192: Test that ParseMultipartForm fails but still parses the
-// multi-part form when an URL containing a semicolon is provided.
+// multi-part form when a URL containing a semicolon is provided.
 func TestParseMultipartFormSemicolonSeparator(t *testing.T) {
        req := newTestMultipartRequest(t)
        req.URL = &url.URL{RawQuery: "q=foo;q=bar"}
index f9e8a285c5e5e5c96f5ab9d0a32126b24b4cd897..fdbc5daa8d430d08062d9dec402459327e948dc5 100644 (file)
@@ -2353,7 +2353,7 @@ func testTransportResponseHeaderTimeout(t *testing.T, mode testMode) {
                        if err != nil {
                                uerr, ok := err.(*url.Error)
                                if !ok {
-                                       t.Errorf("error is not an url.Error; got: %#v", err)
+                                       t.Errorf("error is not a url.Error; got: %#v", err)
                                        continue
                                }
                                nerr, ok := uerr.Err.(net.Error)
@@ -3889,7 +3889,7 @@ func TestTransportCloseIdleConnsThenReturn(t *testing.T) {
 }
 
 // Test for issue 34282
-// Ensure that getConn doesn't call the GotConn trace hook on a HTTP/2 idle conn
+// Ensure that getConn doesn't call the GotConn trace hook on an HTTP/2 idle conn
 func TestTransportTraceGotConnH2IdleConns(t *testing.T) {
        tr := &Transport{}
        wantIdle := func(when string, n int) bool {
@@ -4952,7 +4952,7 @@ func TestTransportRejectsAlphaPort(t *testing.T) {
        }
 }
 
-// Test the httptrace.TLSHandshake{Start,Done} hooks with a https http1
+// Test the httptrace.TLSHandshake{Start,Done} hooks with an https http1
 // connections. The http2 test is done in TestTransportEventTrace_h2
 func TestTLSHandshakeTrace(t *testing.T) {
        run(t, testTLSHandshakeTrace, []testMode{https1Mode, http2Mode})
index 62859a56591abf54bcccfb4e2d6ff184f1fa635a..46f014fc76e50cef17398a18ae467e5e42dcb7bd 100644 (file)
@@ -325,7 +325,7 @@ def iface_dtype(obj):
                return
 
        type_size = int(dynamic_go_type['size'])
-       uintptr_size = int(dynamic_go_type['size'].type.sizeof)  # size is itself an uintptr
+       uintptr_size = int(dynamic_go_type['size'].type.sizeof)  # size is itself a uintptr
        if type_size > uintptr_size:
                        dynamic_gdb_type = dynamic_gdb_type.pointer()
 
index eb9a1693baeed171f8aab03cb62aadd7af4af4fd..2cbc823fd9bdcf41ad3018b85f1fb1d66d1a6053 100644 (file)
@@ -665,7 +665,7 @@ type p struct {
                // We need an explicit length here because this field is used
                // in allocation codepaths where write barriers are not allowed,
                // and eliminating the write barrier/keeping it eliminated from
-               // slice updates is tricky, moreso than just managing the length
+               // slice updates is tricky, more so than just managing the length
                // ourselves.
                len int
                buf [128]*mspan
index cc016833d10fa8c714e8b4e3889de1a69e224f80..179fa93092be71acd2ec35ca13500523bd03f82a 100644 (file)
@@ -111,7 +111,7 @@ func (x *Int64) CompareAndSwap(old, new int64) (swapped bool) {
 // Add atomically adds delta to x and returns the new value.
 func (x *Int64) Add(delta int64) (new int64) { return AddInt64(&x.v, delta) }
 
-// An Uint32 is an atomic uint32. The zero value is zero.
+// A Uint32 is an atomic uint32. The zero value is zero.
 type Uint32 struct {
        _ noCopy
        v uint32
@@ -134,7 +134,7 @@ func (x *Uint32) CompareAndSwap(old, new uint32) (swapped bool) {
 // Add atomically adds delta to x and returns the new value.
 func (x *Uint32) Add(delta uint32) (new uint32) { return AddUint32(&x.v, delta) }
 
-// An Uint64 is an atomic uint64. The zero value is zero.
+// A Uint64 is an atomic uint64. The zero value is zero.
 type Uint64 struct {
        _ noCopy
        _ align64
@@ -158,7 +158,7 @@ func (x *Uint64) CompareAndSwap(old, new uint64) (swapped bool) {
 // Add atomically adds delta to x and returns the new value.
 func (x *Uint64) Add(delta uint64) (new uint64) { return AddUint64(&x.v, delta) }
 
-// An Uintptr is an atomic uintptr. The zero value is zero.
+// A Uintptr is an atomic uintptr. The zero value is zero.
 type Uintptr struct {
        _ noCopy
        v uintptr
index ab00e5ba22eafbf7b3eda2db18ab8f99ddaae1c8..fa7c5c888531764b75b49c13bcc72aea6ffb7054 100644 (file)
@@ -390,7 +390,7 @@ func appendCleanPath(buf []byte, path string, lookupParent bool) ([]byte, bool)
 
 // joinPath concatenates dir and file paths, producing a cleaned path where
 // "." and ".." have been removed, unless dir is relative and the references
-// to parent directories in file represented a location relatie to a parent
+// to parent directories in file represented a location relative to a parent
 // of dir.
 //
 // This function is used for path resolution of all wasi functions expecting