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>
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() {
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)
}
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 {
// 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)
}
// 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)
// 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
// 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.
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' {
// 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
// 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)
// 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
// 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" */ ) {
// 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
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 == "" {
},
},
{
- "Clear Secure flag from a http.",
+ "Clear Secure flag from an http.",
"http://www.host.test/",
[]string{
"b=xx",
}
}
-// 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"} {
}
// 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"}
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)
}
// 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 {
}
}
-// 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})
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()
// 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
// 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
// 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
// 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
// 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