aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcuishuang <imcusg@gmail.com>2025-10-31 17:42:00 +0800
committerRobert Griesemer <gri@google.com>2025-11-03 10:05:39 -0800
commite12d8a90bf877af5984ae74b4eff00006d4d953a (patch)
treefc1688f767f153c697cdaec06b8ace8ddb06e9fa /src
parentc5559344acf76c6ddbbb6f222354a2dd88e0abba (diff)
downloadgo-e12d8a90bf877af5984ae74b4eff00006d4d953a.tar.xz
all: remove extra space in the comments
Change-Id: I26302d801732f40b1fe6b30ff69d222047bca490 Reviewed-on: https://go-review.googlesource.com/c/go/+/716740 Reviewed-by: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/bytes/bytes_test.go2
-rw-r--r--src/cmd/cgo/doc.go2
-rw-r--r--src/cmd/cgo/gcc.go10
-rw-r--r--src/cmd/cgo/internal/test/buildid_linux.go6
-rw-r--r--src/cmd/cgo/internal/test/callback.go2
-rw-r--r--src/cmd/cgo/internal/test/gcc68255/a.go2
-rw-r--r--src/cmd/cgo/internal/teststdio/testdata/fib.go2
-rw-r--r--src/strings/strings_test.go2
8 files changed, 14 insertions, 14 deletions
diff --git a/src/bytes/bytes_test.go b/src/bytes/bytes_test.go
index f18915c879..9547ede312 100644
--- a/src/bytes/bytes_test.go
+++ b/src/bytes/bytes_test.go
@@ -1224,7 +1224,7 @@ func TestMap(t *testing.T) {
// Run a couple of awful growth/shrinkage tests
a := tenRunes('a')
- // 1. Grow. This triggers two reallocations in Map.
+ // 1. Grow. This triggers two reallocations in Map.
maxRune := func(r rune) rune { return unicode.MaxRune }
m := Map(maxRune, []byte(a))
expect := tenRunes(unicode.MaxRune)
diff --git a/src/cmd/cgo/doc.go b/src/cmd/cgo/doc.go
index ef5272299b..7e8486874e 100644
--- a/src/cmd/cgo/doc.go
+++ b/src/cmd/cgo/doc.go
@@ -127,7 +127,7 @@ environment variable when running the go tool: set it to 1 to enable
the use of cgo, and to 0 to disable it. The go tool will set the
build constraint "cgo" if cgo is enabled. The special import "C"
implies the "cgo" build constraint, as though the file also said
-"//go:build cgo". Therefore, if cgo is disabled, files that import
+"//go:build cgo". Therefore, if cgo is disabled, files that import
"C" will not be built by the go tool. (For more about build constraints
see https://golang.org/pkg/go/build/#hdr-Build_Constraints).
diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go
index 886ddf2d46..d1b629057a 100644
--- a/src/cmd/cgo/gcc.go
+++ b/src/cmd/cgo/gcc.go
@@ -1056,7 +1056,7 @@ func (p *Package) rewriteCall(f *File, call *Call) (string, bool) {
func (p *Package) needsPointerCheck(f *File, t ast.Expr, arg ast.Expr) bool {
// An untyped nil does not need a pointer check, and when
// _cgoCheckPointer returns the untyped nil the type assertion we
- // are going to insert will fail. Easier to just skip nil arguments.
+ // are going to insert will fail. Easier to just skip nil arguments.
// TODO: Note that this fails if nil is shadowed.
if id, ok := arg.(*ast.Ident); ok && id.Name == "nil" {
return false
@@ -3010,7 +3010,7 @@ func (c *typeConv) FuncType(dtype *dwarf.FuncType, pos token.Pos) *FuncType {
for i, f := range dtype.ParamType {
// gcc's DWARF generator outputs a single DotDotDotType parameter for
// function pointers that specify no parameters (e.g. void
- // (*__cgo_0)()). Treat this special case as void. This case is
+ // (*__cgo_0)()). Treat this special case as void. This case is
// invalid according to ISO C anyway (i.e. void (*__cgo_1)(...) is not
// legal).
if _, ok := f.(*dwarf.DotDotDotType); ok && i == 0 {
@@ -3081,7 +3081,7 @@ func (c *typeConv) Struct(dt *dwarf.StructType, pos token.Pos) (expr *ast.Struct
off := int64(0)
// Rename struct fields that happen to be named Go keywords into
- // _{keyword}. Create a map from C ident -> Go ident. The Go ident will
+ // _{keyword}. Create a map from C ident -> Go ident. The Go ident will
// be mangled. Any existing identifier that already has the same name on
// the C-side will cause the Go-mangled version to be prefixed with _.
// (e.g. in a struct with fields '_type' and 'type', the latter would be
@@ -3309,7 +3309,7 @@ func godefsFields(fld []*ast.Field) {
// fieldPrefix returns the prefix that should be removed from all the
// field names when generating the C or Go code. For generated
// C, we leave the names as is (tv_sec, tv_usec), since that's what
-// people are used to seeing in C. For generated Go code, such as
+// people are used to seeing in C. For generated Go code, such as
// package syscall's data structures, we drop a common prefix
// (so sec, usec, which will get turned into Sec, Usec for exporting).
func fieldPrefix(fld []*ast.Field) string {
@@ -3456,7 +3456,7 @@ func (c *typeConv) badCFType(dt *dwarf.TypedefType) bool {
// Tagged pointer support
// Low-bit set means tagged object, next 3 bits (currently)
// define the tagged object class, next 4 bits are for type
-// information for the specific tagged object class. Thus,
+// information for the specific tagged object class. Thus,
// the low byte is for type info, and the rest of a pointer
// (32 or 64-bit) is for payload, whatever the tagged class.
//
diff --git a/src/cmd/cgo/internal/test/buildid_linux.go b/src/cmd/cgo/internal/test/buildid_linux.go
index 84d3edb664..7e0fd0fd12 100644
--- a/src/cmd/cgo/internal/test/buildid_linux.go
+++ b/src/cmd/cgo/internal/test/buildid_linux.go
@@ -4,9 +4,9 @@
package cgotest
-// Test that we have no more than one build ID. In the past we used
+// Test that we have no more than one build ID. In the past we used
// to generate a separate build ID for each package using cgo, and the
-// linker concatenated them all. We don't want that--we only want
+// linker concatenated them all. We don't want that--we only want
// one.
import (
@@ -42,7 +42,7 @@ sections:
for len(d) > 0 {
// ELF standards differ as to the sizes in
- // note sections. Both the GNU linker and
+ // note sections. Both the GNU linker and
// gold always generate 32-bit sizes, so that
// is what we assume here.
diff --git a/src/cmd/cgo/internal/test/callback.go b/src/cmd/cgo/internal/test/callback.go
index 478bf8294a..8f8dd8fded 100644
--- a/src/cmd/cgo/internal/test/callback.go
+++ b/src/cmd/cgo/internal/test/callback.go
@@ -40,7 +40,7 @@ func nestedCall(f func()) {
callbackMutex.Unlock()
// Pass the address of i because the C function was written to
- // take a pointer. We could pass an int if we felt like
+ // take a pointer. We could pass an int if we felt like
// rewriting the C code.
C.callback(unsafe.Pointer(&i))
diff --git a/src/cmd/cgo/internal/test/gcc68255/a.go b/src/cmd/cgo/internal/test/gcc68255/a.go
index e106dee3ec..cc4804b90b 100644
--- a/src/cmd/cgo/internal/test/gcc68255/a.go
+++ b/src/cmd/cgo/internal/test/gcc68255/a.go
@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.
// Test that it's OK to have C code that does nothing other than
-// initialize a global variable. This used to fail with gccgo.
+// initialize a global variable. This used to fail with gccgo.
package gcc68255
diff --git a/src/cmd/cgo/internal/teststdio/testdata/fib.go b/src/cmd/cgo/internal/teststdio/testdata/fib.go
index 9617368335..69147880c2 100644
--- a/src/cmd/cgo/internal/teststdio/testdata/fib.go
+++ b/src/cmd/cgo/internal/teststdio/testdata/fib.go
@@ -5,7 +5,7 @@
//go:build test_run
// Compute Fibonacci numbers with two goroutines
-// that pass integers back and forth. No actual
+// that pass integers back and forth. No actual
// concurrency, just threads and synchronization
// and foreign code on multiple pthreads.
diff --git a/src/strings/strings_test.go b/src/strings/strings_test.go
index b10b5f05cc..edfeb0e813 100644
--- a/src/strings/strings_test.go
+++ b/src/strings/strings_test.go
@@ -694,7 +694,7 @@ func rot13(r rune) rune {
func TestMap(t *testing.T) {
// Run a couple of awful growth/shrinkage tests
a := tenRunes('a')
- // 1. Grow. This triggers two reallocations in Map.
+ // 1. Grow. This triggers two reallocations in Map.
maxRune := func(rune) rune { return unicode.MaxRune }
m := Map(maxRune, a)
expect := tenRunes(unicode.MaxRune)