Skip to content

Commit

Permalink
all: fix typos as reported by 'misspell'
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
leonklingele authored and bradfitz committed Feb 26, 2019
1 parent 337662f commit d090429
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/cmd/compile/internal/gc/inl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/ssa/html.go
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/cmd/trace/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/cmd/trace/goroutines.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/internal/xcoff/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/os/os_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/mem_bsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/mgcstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++
}

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/symtab.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/syscall/syscall_aix.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/testing/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit d090429

Please sign in to comment.