Commit f3913624 authored by Robert Griesemer's avatar Robert Griesemer

std lib: fix various typos in comments

Where the spelling changed from British to
US norm (e.g., optimise -> optimize) it follows
the style in that file.

LGTM=adonovan
R=golang-codereviews, adonovan
CC=golang-codereviews
https://golang.org/cl/96980043
parent ab5247ef
...@@ -817,7 +817,7 @@ func (w *Walker) emitFunc(f *types.Func) { ...@@ -817,7 +817,7 @@ func (w *Walker) emitFunc(f *types.Func) {
func (w *Walker) emitMethod(m *types.Selection) { func (w *Walker) emitMethod(m *types.Selection) {
sig := m.Type().(*types.Signature) sig := m.Type().(*types.Signature)
recv := sig.Recv().Type() recv := sig.Recv().Type()
// report exported methods with unexported reveiver base type // report exported methods with unexported receiver base type
if true { if true {
base := recv base := recv
if p, _ := recv.(*types.Pointer); p != nil { if p, _ := recv.(*types.Pointer); p != nil {
......
...@@ -153,7 +153,7 @@ func clean(p *Package) { ...@@ -153,7 +153,7 @@ func clean(p *Package) {
elem+".test.exe", elem+".test.exe",
) )
// Remove a potental executable for each .go file in the directory that // Remove a potential executable for each .go file in the directory that
// is not part of the directory's package. // is not part of the directory's package.
for _, dir := range dirs { for _, dir := range dirs {
name := dir.Name() name := dir.Name()
......
...@@ -73,7 +73,7 @@ func runGet(cmd *Command, args []string) { ...@@ -73,7 +73,7 @@ func runGet(cmd *Command, args []string) {
} }
exitIfErrors() exitIfErrors()
// Phase 2. Rescan packages and reevaluate args list. // Phase 2. Rescan packages and re-evaluate args list.
// Code we downloaded and all code that depends on it // Code we downloaded and all code that depends on it
// needs to be evicted from the package cache so that // needs to be evicted from the package cache so that
......
...@@ -78,7 +78,7 @@ func Remove(h Interface, i int) interface{} { ...@@ -78,7 +78,7 @@ func Remove(h Interface, i int) interface{} {
return h.Pop() return h.Pop()
} }
// Fix reestablishes the heap ordering after the element at index i has changed its value. // Fix re-establishes the heap ordering after the element at index i has changed its value.
// Changing the value of the element at index i and then calling Fix is equivalent to, // Changing the value of the element at index i and then calling Fix is equivalent to,
// but less expensive than, calling Remove(h, i) followed by a Push of the new value. // but less expensive than, calling Remove(h, i) followed by a Push of the new value.
// The complexity is O(log(n)) where n = h.Len(). // The complexity is O(log(n)) where n = h.Len().
......
...@@ -141,7 +141,7 @@ func hashForServerKeyExchange(sigType, hashFunc uint8, version uint16, slices .. ...@@ -141,7 +141,7 @@ func hashForServerKeyExchange(sigType, hashFunc uint8, version uint16, slices ..
// pickTLS12HashForSignature returns a TLS 1.2 hash identifier for signing a // pickTLS12HashForSignature returns a TLS 1.2 hash identifier for signing a
// ServerKeyExchange given the signature type being used and the client's // ServerKeyExchange given the signature type being used and the client's
// advertized list of supported signature and hash combinations. // advertised list of supported signature and hash combinations.
func pickTLS12HashForSignature(sigType uint8, clientSignatureAndHashes []signatureAndHash) (uint8, error) { func pickTLS12HashForSignature(sigType uint8, clientSignatureAndHashes []signatureAndHash) (uint8, error) {
if len(clientSignatureAndHashes) == 0 { if len(clientSignatureAndHashes) == 0 {
// If the client didn't specify any signature_algorithms // If the client didn't specify any signature_algorithms
......
...@@ -47,7 +47,7 @@ func (z *Rat) SetFloat64(f float64) *Rat { ...@@ -47,7 +47,7 @@ func (z *Rat) SetFloat64(f float64) *Rat {
shift := 52 - exp shift := 52 - exp
// Optimisation (?): partially pre-normalise. // Optimization (?): partially pre-normalise.
for mantissa&1 == 0 && shift > 0 { for mantissa&1 == 0 && shift > 0 {
mantissa >>= 1 mantissa >>= 1
shift-- shift--
......
...@@ -43,7 +43,7 @@ import "math" ...@@ -43,7 +43,7 @@ import "math"
// IEEE -10,+10 30000 9.4e-15 1.5e-15 // IEEE -10,+10 30000 9.4e-15 1.5e-15
// Pow returns x**y, the base-x exponential of y. // Pow returns x**y, the base-x exponential of y.
// For generalized compatiblity with math.Pow: // For generalized compatibility with math.Pow:
// Pow(0, ±0) returns 1+0i // Pow(0, ±0) returns 1+0i
// Pow(0, c) for real(c)<0 returns Inf+0i if imag(c) is zero, otherwise Inf+Inf i. // Pow(0, c) for real(c)<0 returns Inf+0i if imag(c) is zero, otherwise Inf+Inf i.
func Pow(x, y complex128) complex128 { func Pow(x, y complex128) complex128 {
......
...@@ -527,7 +527,7 @@ func (w *countingWriter) Write(p []byte) (n int, err error) { ...@@ -527,7 +527,7 @@ func (w *countingWriter) Write(p []byte) (n int, err error) {
return len(p), nil return len(p), nil
} }
// rangesMIMESize returns the nunber of bytes it takes to encode the // rangesMIMESize returns the number of bytes it takes to encode the
// provided ranges as a multipart response. // provided ranges as a multipart response.
func rangesMIMESize(ranges []httpRange, contentType string, contentSize int64) (encSize int64) { func rangesMIMESize(ranges []httpRange, contentType string, contentSize int64) (encSize int64) {
var w countingWriter var w countingWriter
......
...@@ -16,7 +16,7 @@ var ( ...@@ -16,7 +16,7 @@ var (
// networking functionality. // networking functionality.
supportsIPv4 bool supportsIPv4 bool
// supportsIPv6 reports whether the platfrom supports IPv6 // supportsIPv6 reports whether the platform supports IPv6
// networking functionality. // networking functionality.
supportsIPv6 bool supportsIPv6 bool
...@@ -207,7 +207,7 @@ missingBrackets: ...@@ -207,7 +207,7 @@ missingBrackets:
} }
func splitHostZone(s string) (host, zone string) { func splitHostZone(s string) (host, zone string) {
// The IPv6 scoped addressing zone identifer starts after the // The IPv6 scoped addressing zone identifier starts after the
// last percent sign. // last percent sign.
if i := last(s, '%'); i > 0 { if i := last(s, '%'); i > 0 {
host, zone = s[:i], s[i+1:] host, zone = s[:i], s[i+1:]
...@@ -232,7 +232,7 @@ func JoinHostPort(host, port string) string { ...@@ -232,7 +232,7 @@ func JoinHostPort(host, port string) string {
// address or a DNS name and returns an internet protocol family // address or a DNS name and returns an internet protocol family
// address. It returns a list that contains a pair of different // address. It returns a list that contains a pair of different
// address family addresses when addr is a DNS name and the name has // address family addresses when addr is a DNS name and the name has
// mutiple address family records. The result contains at least one // multiple address family records. The result contains at least one
// address when error is nil. // address when error is nil.
func resolveInternetAddr(net, addr string, deadline time.Time) (netaddr, error) { func resolveInternetAddr(net, addr string, deadline time.Time) (netaddr, error) {
var ( var (
......
...@@ -23,7 +23,7 @@ const maxSendfileSize int = 4 << 20 ...@@ -23,7 +23,7 @@ const maxSendfileSize int = 4 << 20
// if handled == false, sendFile performed no work. // if handled == false, sendFile performed no work.
func sendFile(c *netFD, r io.Reader) (written int64, err error, handled bool) { func sendFile(c *netFD, r io.Reader) (written int64, err error, handled bool) {
// DragonFly uses 0 as the "until EOF" value. If you pass in more bytes than the // DragonFly uses 0 as the "until EOF" value. If you pass in more bytes than the
// file contains, it will loop back to the beginning ad nauseum until it's sent // file contains, it will loop back to the beginning ad nauseam until it's sent
// exactly the number of bytes told to. As such, we need to know exactly how many // exactly the number of bytes told to. As such, we need to know exactly how many
// bytes to send. // bytes to send.
var remain int64 = 0 var remain int64 = 0
......
...@@ -23,7 +23,7 @@ const maxSendfileSize int = 4 << 20 ...@@ -23,7 +23,7 @@ const maxSendfileSize int = 4 << 20
// if handled == false, sendFile performed no work. // if handled == false, sendFile performed no work.
func sendFile(c *netFD, r io.Reader) (written int64, err error, handled bool) { func sendFile(c *netFD, r io.Reader) (written int64, err error, handled bool) {
// FreeBSD uses 0 as the "until EOF" value. If you pass in more bytes than the // FreeBSD uses 0 as the "until EOF" value. If you pass in more bytes than the
// file contains, it will loop back to the beginning ad nauseum until it's sent // file contains, it will loop back to the beginning ad nauseam until it's sent
// exactly the number of bytes told to. As such, we need to know exactly how many // exactly the number of bytes told to. As such, we need to know exactly how many
// bytes to send. // bytes to send.
var remain int64 = 0 var remain int64 = 0
......
...@@ -597,7 +597,7 @@ func (p runeSlice) Sort() { ...@@ -597,7 +597,7 @@ func (p runeSlice) Sort() {
// makeOnePass creates a onepass Prog, if possible. It is possible if at any alt, // makeOnePass creates a onepass Prog, if possible. It is possible if at any alt,
// the match engine can always tell which branch to take. The routine may modify // the match engine can always tell which branch to take. The routine may modify
// p if it is turned into a onepass Prog. If it isn't possible for this to be a // p if it is turned into a onepass Prog. If it isn't possible for this to be a
// onepass Prog, the Prog syntax.NotOnePass is returned. makeOnePass is resursive // onepass Prog, the Prog syntax.NotOnePass is returned. makeOnePass is recursive
// to the size of the Prog // to the size of the Prog
func (p *Prog) makeOnePass() *Prog { func (p *Prog) makeOnePass() *Prog {
var ( var (
......
...@@ -20,7 +20,7 @@ import ( ...@@ -20,7 +20,7 @@ import (
"text/tabwriter" "text/tabwriter"
) )
// BUG(rsc): Profiles are incomplete and inaccuate on NetBSD and OS X. // BUG(rsc): Profiles are incomplete and inaccurate on NetBSD and OS X.
// See http://golang.org/issue/6047 for details. // See http://golang.org/issue/6047 for details.
// A Profile is a collection of stack traces showing the call sequences // A Profile is a collection of stack traces showing the call sequences
......
...@@ -287,7 +287,7 @@ func StringsAreSorted(a []string) bool { return IsSorted(StringSlice(a)) } ...@@ -287,7 +287,7 @@ func StringsAreSorted(a []string) bool { return IsSorted(StringSlice(a)) }
// Notes on stable sorting: // Notes on stable sorting:
// The used algorithms are simple and provable correct on all input and use // The used algorithms are simple and provable correct on all input and use
// only logarithmic additional stack space. They perform well if compared // only logarithmic additional stack space. They perform well if compared
// experimentaly to other stable in-place sorting algorithms. // experimentally to other stable in-place sorting algorithms.
// //
// Remarks on other algorithms evaluated: // Remarks on other algorithms evaluated:
// - GCC's 4.6.3 stable_sort with merge_without_buffer from libstdc++: // - GCC's 4.6.3 stable_sort with merge_without_buffer from libstdc++:
......
...@@ -54,7 +54,7 @@ var nullDir = Dir{ ...@@ -54,7 +54,7 @@ var nullDir = Dir{
} }
// Null assigns special "don't touch" values to members of d to // Null assigns special "don't touch" values to members of d to
// avoid modifiying them during syscall.Wstat. // avoid modifying them during syscall.Wstat.
func (d *Dir) Null() { *d = nullDir } func (d *Dir) Null() { *d = nullDir }
// Marshal encodes a 9P stat message corresponding to d into b // Marshal encodes a 9P stat message corresponding to d into b
......
...@@ -194,7 +194,7 @@ func Seek(fd int, offset int64, whence int) (int64, error) { ...@@ -194,7 +194,7 @@ func Seek(fd int, offset int64, whence int) (int64, error) {
return f.impl.seek(offset, whence) return f.impl.seek(offset, whence)
} }
// defaulFileImpl imlements fileImpl. // defaulFileImpl implements fileImpl.
// It can be embedded to complete a partial fileImpl implementation. // It can be embedded to complete a partial fileImpl implementation.
type defaultFileImpl struct{} type defaultFileImpl struct{}
......
...@@ -135,7 +135,7 @@ func (p *Param) TmpVarCode() string { ...@@ -135,7 +135,7 @@ func (p *Param) TmpVarCode() string {
} }
// SyscallArgList returns source code fragments representing p parameter // SyscallArgList returns source code fragments representing p parameter
// in syscall. Slices are transated into 2 syscall parameters: pointer to // in syscall. Slices are translated into 2 syscall parameters: pointer to
// the first element and length. // the first element and length.
func (p *Param) SyscallArgList() []string { func (p *Param) SyscallArgList() []string {
var s string var s string
...@@ -321,7 +321,7 @@ func extractParams(s string, f *Fn) ([]*Param, error) { ...@@ -321,7 +321,7 @@ func extractParams(s string, f *Fn) ([]*Param, error) {
// extractSection extracts text out of string s starting after start // extractSection extracts text out of string s starting after start
// and ending just before end. found return value will indicate success, // and ending just before end. found return value will indicate success,
// and prefix, body and sufix will contain correspondent parts of string s. // and prefix, body and suffix will contain correspondent parts of string s.
func extractSection(s string, start, end rune) (prefix, body, suffix string, found bool) { func extractSection(s string, start, end rune) (prefix, body, suffix string, found bool) {
s = trim(s) s = trim(s)
if strings.HasPrefix(s, string(start)) { if strings.HasPrefix(s, string(start)) {
...@@ -617,7 +617,7 @@ func main() { ...@@ -617,7 +617,7 @@ func main() {
} }
} }
// TODO: use println instead to print in the folowing template // TODO: use println instead to print in the following template
const srcTemplate = ` const srcTemplate = `
{{define "main"}}// go build mksyscall_windows.go && ./mksyscall_windows{{range .Files}} {{.}}{{end}} {{define "main"}}// go build mksyscall_windows.go && ./mksyscall_windows{{range .Files}} {{.}}{{end}}
......
...@@ -30,7 +30,7 @@ func (any *anyMessage) toRoutingMessage(b []byte) RoutingMessage { ...@@ -30,7 +30,7 @@ func (any *anyMessage) toRoutingMessage(b []byte) RoutingMessage {
} }
// InterfaceAnnounceMessage represents a routing message containing // InterfaceAnnounceMessage represents a routing message containing
// network interface arrival and depature information. // network interface arrival and departure information.
type InterfaceAnnounceMessage struct { type InterfaceAnnounceMessage struct {
Header IfAnnounceMsghdr Header IfAnnounceMsghdr
} }
......
...@@ -36,7 +36,7 @@ func (any *anyMessage) toRoutingMessage(b []byte) RoutingMessage { ...@@ -36,7 +36,7 @@ func (any *anyMessage) toRoutingMessage(b []byte) RoutingMessage {
} }
// InterfaceAnnounceMessage represents a routing message containing // InterfaceAnnounceMessage represents a routing message containing
// network interface arrival and depature information. // network interface arrival and departure information.
type InterfaceAnnounceMessage struct { type InterfaceAnnounceMessage struct {
Header IfAnnounceMsghdr Header IfAnnounceMsghdr
} }
......
...@@ -27,7 +27,7 @@ func (any *anyMessage) toRoutingMessage(b []byte) RoutingMessage { ...@@ -27,7 +27,7 @@ func (any *anyMessage) toRoutingMessage(b []byte) RoutingMessage {
} }
// InterfaceAnnounceMessage represents a routing message containing // InterfaceAnnounceMessage represents a routing message containing
// network interface arrival and depature information. // network interface arrival and departure information.
type InterfaceAnnounceMessage struct { type InterfaceAnnounceMessage struct {
Header IfAnnounceMsghdr Header IfAnnounceMsghdr
} }
......
...@@ -27,7 +27,7 @@ func (any *anyMessage) toRoutingMessage(b []byte) RoutingMessage { ...@@ -27,7 +27,7 @@ func (any *anyMessage) toRoutingMessage(b []byte) RoutingMessage {
} }
// InterfaceAnnounceMessage represents a routing message containing // InterfaceAnnounceMessage represents a routing message containing
// network interface arrival and depature information. // network interface arrival and departure information.
type InterfaceAnnounceMessage struct { type InterfaceAnnounceMessage struct {
Header IfAnnounceMsghdr Header IfAnnounceMsghdr
} }
......
...@@ -90,7 +90,7 @@ func toEnglishName(stdname, dstname string) (string, error) { ...@@ -90,7 +90,7 @@ func toEnglishName(stdname, dstname string) (string, error) {
return "", errors.New(`English name for time zone "` + stdname + `" not found in registry`) return "", errors.New(`English name for time zone "` + stdname + `" not found in registry`)
} }
// extractCAPS exracts capital letters from description desc. // extractCAPS extracts capital letters from description desc.
func extractCAPS(desc string) string { func extractCAPS(desc string) string {
var short []rune var short []rune
for _, c := range desc { for _, c := range desc {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment