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": {
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
}
// 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;
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
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
// 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:
// 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)
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.
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++
}
}
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 {
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
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()