From d090429ea9af7cc2958fd95460196b02212c2b62 Mon Sep 17 00:00:00 2001
From: Leon Klingele <git@leonklingele.de>
Date: Fri, 22 Feb 2019 15:53:52 +0000
Subject: [PATCH] all: fix typos as reported by 'misspell'

Change-Id: I904b8655f21743189814bccf24073b6fbb9fc56d
GitHub-Last-Rev: b032c14394c949f9ad7b18d019a3979d38d4e1fb
GitHub-Pull-Request: golang/go#29997
Reviewed-on: https://go-review.googlesource.com/c/160421
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
---
 src/cmd/compile/internal/gc/inl_test.go | 4 ++--
 src/cmd/compile/internal/ssa/html.go    | 2 +-
 src/cmd/trace/annotations.go            | 8 ++++----
 src/cmd/trace/goroutines.go             | 8 ++++----
 src/internal/xcoff/file.go              | 4 ++--
 src/os/os_windows_test.go               | 2 +-
 src/runtime/mem_bsd.go                  | 2 +-
 src/runtime/mgcstack.go                 | 2 +-
 src/runtime/symtab.go                   | 2 +-
 src/syscall/syscall_aix.go              | 2 +-
 src/testing/testing.go                  | 2 +-
 11 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/cmd/compile/internal/gc/inl_test.go b/src/cmd/compile/internal/gc/inl_test.go
index 58d13f2dcf5..c29c1755f36 100644
--- a/src/cmd/compile/internal/gc/inl_test.go
+++ b/src/cmd/compile/internal/gc/inl_test.go
@@ -26,7 +26,7 @@ func TestIntendedInlining(t *testing.T) {
 	t.Parallel()
 
 	// want is the list of function names (by package) that should
-	// be inlinable. If they have no callers in thier packages, they
+	// be inlinable. If they have no callers in their packages, they
 	// might not actually be inlined anywhere.
 	want := map[string][]string{
 		"runtime": {
@@ -218,7 +218,7 @@ func TestIntendedInlining(t *testing.T) {
 		if m := canInline.FindStringSubmatch(line); m != nil {
 			fname := m[1]
 			fullname := curPkg + "." + fname
-			// If function must be inlined somewhere, beeing inlinable is not enough
+			// If function must be inlined somewhere, being inlinable is not enough
 			if _, ok := must[fullname]; !ok {
 				delete(notInlinedReason, fullname)
 				continue
diff --git a/src/cmd/compile/internal/ssa/html.go b/src/cmd/compile/internal/ssa/html.go
index 1202987acc4..a1b718096d7 100644
--- a/src/cmd/compile/internal/ssa/html.go
+++ b/src/cmd/compile/internal/ssa/html.go
@@ -1080,7 +1080,7 @@ type dotWriter struct {
 }
 
 // newDotWriter returns non-nil value when mask is valid.
-// dotWriter will generate SVGs only for the phases specifed in the mask.
+// dotWriter will generate SVGs only for the phases specified in the mask.
 // mask can contain following patterns and combinations of them:
 // *   - all of them;
 // x-y - x through y, inclusive;
diff --git a/src/cmd/trace/annotations.go b/src/cmd/trace/annotations.go
index 24984156811..d991588a727 100644
--- a/src/cmd/trace/annotations.go
+++ b/src/cmd/trace/annotations.go
@@ -1159,17 +1159,17 @@ var templUserRegionType = template.Must(template.New("").Funcs(template.FuncMap{
 		d := time.Duration(nsec) * time.Nanosecond
 		return template.HTML(niceDuration(d))
 	},
-	"percent": func(dividened, divisor int64) template.HTML {
+	"percent": func(dividend, divisor int64) template.HTML {
 		if divisor == 0 {
 			return ""
 		}
-		return template.HTML(fmt.Sprintf("(%.1f%%)", float64(dividened)/float64(divisor)*100))
+		return template.HTML(fmt.Sprintf("(%.1f%%)", float64(dividend)/float64(divisor)*100))
 	},
-	"barLen": func(dividened, divisor int64) template.HTML {
+	"barLen": func(dividend, divisor int64) template.HTML {
 		if divisor == 0 {
 			return "0"
 		}
-		return template.HTML(fmt.Sprintf("%.2f%%", float64(dividened)/float64(divisor)*100))
+		return template.HTML(fmt.Sprintf("%.2f%%", float64(dividend)/float64(divisor)*100))
 	},
 	"unknownTime": func(desc regionDesc) int64 {
 		sum := desc.ExecTime + desc.IOTime + desc.BlockTime + desc.SyscallTime + desc.SchedWaitTime
diff --git a/src/cmd/trace/goroutines.go b/src/cmd/trace/goroutines.go
index 548871a82c2..100891d64e0 100644
--- a/src/cmd/trace/goroutines.go
+++ b/src/cmd/trace/goroutines.go
@@ -166,17 +166,17 @@ var templGoroutine = template.Must(template.New("").Funcs(template.FuncMap{
 		d := time.Duration(nsec) * time.Nanosecond
 		return template.HTML(niceDuration(d))
 	},
-	"percent": func(dividened, divisor int64) template.HTML {
+	"percent": func(dividend, divisor int64) template.HTML {
 		if divisor == 0 {
 			return ""
 		}
-		return template.HTML(fmt.Sprintf("(%.1f%%)", float64(dividened)/float64(divisor)*100))
+		return template.HTML(fmt.Sprintf("(%.1f%%)", float64(dividend)/float64(divisor)*100))
 	},
-	"barLen": func(dividened, divisor int64) template.HTML {
+	"barLen": func(dividend, divisor int64) template.HTML {
 		if divisor == 0 {
 			return "0"
 		}
-		return template.HTML(fmt.Sprintf("%.2f%%", float64(dividened)/float64(divisor)*100))
+		return template.HTML(fmt.Sprintf("%.2f%%", float64(dividend)/float64(divisor)*100))
 	},
 	"unknownTime": func(desc *trace.GDesc) int64 {
 		sum := desc.ExecTime + desc.IOTime + desc.BlockTime + desc.SyscallTime + desc.SchedWaitTime
diff --git a/src/internal/xcoff/file.go b/src/internal/xcoff/file.go
index 0923b9fcf3a..66b5391d583 100644
--- a/src/internal/xcoff/file.go
+++ b/src/internal/xcoff/file.go
@@ -334,8 +334,8 @@ func NewFile(r io.ReaderAt) (*File, error) {
 
 		// If this symbol is a function, it must retrieve its size from
 		// its AUX_FCN entry.
-		// It can happend that a function symbol doesn't have any AUX_FCN.
-		// In this case, needAuxFcn is false and their size will be set to 0
+		// It can happen that a function symbol doesn't have any AUX_FCN.
+		// In this case, needAuxFcn is false and their size will be set to 0.
 		if needAuxFcn {
 			switch f.TargetMachine {
 			case U802TOCMAGIC:
diff --git a/src/os/os_windows_test.go b/src/os/os_windows_test.go
index 285e1eb35e9..dc9e629b013 100644
--- a/src/os/os_windows_test.go
+++ b/src/os/os_windows_test.go
@@ -1013,7 +1013,7 @@ func TestStatOfInvalidName(t *testing.T) {
 // It returns path to the found drive root directory (like Z:\) or error.
 func findUnusedDriveLetter() (string, error) {
 	// Do not use A: and B:, because they are reserved for floppy drive.
-	// Do not use C:, becasue it is normally used for main drive.
+	// Do not use C:, because it is normally used for main drive.
 	for l := 'Z'; l >= 'D'; l-- {
 		p := string(l) + `:\`
 		_, err := os.Stat(p)
diff --git a/src/runtime/mem_bsd.go b/src/runtime/mem_bsd.go
index 84238d7279f..796bb442232 100644
--- a/src/runtime/mem_bsd.go
+++ b/src/runtime/mem_bsd.go
@@ -45,7 +45,7 @@ func sysReserve(v unsafe.Pointer, n uintptr) unsafe.Pointer {
 	flags := int32(_MAP_ANON | _MAP_PRIVATE)
 	if raceenabled && GOOS == "darwin" {
 		// Currently the race detector expects memory to live within a certain
-		// range, and on Darwin 10.10 mmap is prone to ignoring hints, moreso
+		// range, and on Darwin 10.10 mmap is prone to ignoring hints, more so
 		// than later versions and other BSDs (#26475). So, even though it's
 		// potentially dangerous to MAP_FIXED, we do it in the race detection
 		// case because it'll help maintain the race detector's invariants.
diff --git a/src/runtime/mgcstack.go b/src/runtime/mgcstack.go
index 86e60d43815..baeaa4fd559 100644
--- a/src/runtime/mgcstack.go
+++ b/src/runtime/mgcstack.go
@@ -274,7 +274,7 @@ func (s *stackScanState) addObject(addr uintptr, typ *_type) {
 	obj.off = uint32(addr - s.stack.lo)
 	obj.size = uint32(typ.size)
 	obj.setType(typ)
-	// obj.left and obj.right will be initalized by buildIndex before use.
+	// obj.left and obj.right will be initialized by buildIndex before use.
 	s.nobjs++
 }
 
diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go
index 17e342ef699..a7538482dc6 100644
--- a/src/runtime/symtab.go
+++ b/src/runtime/symtab.go
@@ -475,7 +475,7 @@ func FuncForPC(pc uintptr) *Func {
 	}
 	if inldata := funcdata(f, _FUNCDATA_InlTree); inldata != nil {
 		// Note: strict=false so bad PCs (those between functions) don't crash the runtime.
-		// We just report the preceeding function in that situation. See issue 29735.
+		// We just report the preceding function in that situation. See issue 29735.
 		// TODO: Perhaps we should report no function at all in that case.
 		// The runtime currently doesn't have function end info, alas.
 		if ix := pcdatavalue1(f, _PCDATA_InlTreeIndex, pc, nil, false); ix >= 0 {
diff --git a/src/syscall/syscall_aix.go b/src/syscall/syscall_aix.go
index 6512761c338..ea88c666bec 100644
--- a/src/syscall/syscall_aix.go
+++ b/src/syscall/syscall_aix.go
@@ -388,7 +388,7 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error)
 func (sa *RawSockaddrUnix) getLen() (int, error) {
 	// Some versions of AIX have a bug in getsockname (see IV78655).
 	// We can't rely on sa.Len being set correctly.
-	n := SizeofSockaddrUnix - 3 // substract leading Family, Len, terminating NUL.
+	n := SizeofSockaddrUnix - 3 // subtract leading Family, Len, terminating NUL.
 	for i := 0; i < n; i++ {
 		if sa.Path[i] == 0 {
 			n = i
diff --git a/src/testing/testing.go b/src/testing/testing.go
index 3068630e8a9..79dcf76908a 100644
--- a/src/testing/testing.go
+++ b/src/testing/testing.go
@@ -614,7 +614,7 @@ func (c *common) log(s string) {
 	c.logDepth(s, 3) // logDepth + log + public function
 }
 
-// logDepth generates the output. At an arbitary stack depth
+// logDepth generates the output at an arbitrary stack depth.
 func (c *common) logDepth(s string, depth int) {
 	c.mu.Lock()
 	defer c.mu.Unlock()
-- 
GitLab