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
diff --git a/src/pkg/container/heap/heap.go b/src/pkg/container/heap/heap.go index 3fe2327..c467a11 100644 --- a/src/pkg/container/heap/heap.go +++ b/src/pkg/container/heap/heap.go
@@ -78,7 +78,7 @@ 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, // 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().
diff --git a/src/pkg/crypto/tls/key_agreement.go b/src/pkg/crypto/tls/key_agreement.go index 94bb5e9..f38b701 100644 --- a/src/pkg/crypto/tls/key_agreement.go +++ b/src/pkg/crypto/tls/key_agreement.go
@@ -141,7 +141,7 @@ // pickTLS12HashForSignature returns a TLS 1.2 hash identifier for signing a // 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) { if len(clientSignatureAndHashes) == 0 { // If the client didn't specify any signature_algorithms
diff --git a/src/pkg/math/big/rat.go b/src/pkg/math/big/rat.go index 0fd19c6..f0973b3 100644 --- a/src/pkg/math/big/rat.go +++ b/src/pkg/math/big/rat.go
@@ -47,7 +47,7 @@ shift := 52 - exp - // Optimisation (?): partially pre-normalise. + // Optimization (?): partially pre-normalise. for mantissa&1 == 0 && shift > 0 { mantissa >>= 1 shift--
diff --git a/src/pkg/math/cmplx/pow.go b/src/pkg/math/cmplx/pow.go index 81821a3..1630b87 100644 --- a/src/pkg/math/cmplx/pow.go +++ b/src/pkg/math/cmplx/pow.go
@@ -43,7 +43,7 @@ // IEEE -10,+10 30000 9.4e-15 1.5e-15 // 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, c) for real(c)<0 returns Inf+0i if imag(c) is zero, otherwise Inf+Inf i. func Pow(x, y complex128) complex128 {
diff --git a/src/pkg/net/http/fs.go b/src/pkg/net/http/fs.go index 9df5cc4..8576cf8 100644 --- a/src/pkg/net/http/fs.go +++ b/src/pkg/net/http/fs.go
@@ -527,7 +527,7 @@ 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. func rangesMIMESize(ranges []httpRange, contentType string, contentSize int64) (encSize int64) { var w countingWriter
diff --git a/src/pkg/net/ipsock.go b/src/pkg/net/ipsock.go index 8b586ef..dda8578 100644 --- a/src/pkg/net/ipsock.go +++ b/src/pkg/net/ipsock.go
@@ -16,7 +16,7 @@ // networking functionality. supportsIPv4 bool - // supportsIPv6 reports whether the platfrom supports IPv6 + // supportsIPv6 reports whether the platform supports IPv6 // networking functionality. supportsIPv6 bool @@ -207,7 +207,7 @@ } 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. if i := last(s, '%'); i > 0 { host, zone = s[:i], s[i+1:] @@ -232,7 +232,7 @@ // address or a DNS name and returns an internet protocol family // address. It returns a list that contains a pair of different // 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. func resolveInternetAddr(net, addr string, deadline time.Time) (netaddr, error) { var (
diff --git a/src/pkg/net/sendfile_dragonfly.go b/src/pkg/net/sendfile_dragonfly.go index a2219c1..bc88fd3 100644 --- a/src/pkg/net/sendfile_dragonfly.go +++ b/src/pkg/net/sendfile_dragonfly.go
@@ -23,7 +23,7 @@ // if handled == false, sendFile performed no work. 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 - // 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 // bytes to send. var remain int64 = 0
diff --git a/src/pkg/net/sendfile_freebsd.go b/src/pkg/net/sendfile_freebsd.go index 42fe799..ffc1472 100644 --- a/src/pkg/net/sendfile_freebsd.go +++ b/src/pkg/net/sendfile_freebsd.go
@@ -23,7 +23,7 @@ // if handled == false, sendFile performed no work. 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 - // 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 // bytes to send. var remain int64 = 0
diff --git a/src/pkg/regexp/syntax/prog.go b/src/pkg/regexp/syntax/prog.go index c4563ae..089b90d 100644 --- a/src/pkg/regexp/syntax/prog.go +++ b/src/pkg/regexp/syntax/prog.go
@@ -597,7 +597,7 @@ // 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 // 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 func (p *Prog) makeOnePass() *Prog { var (
diff --git a/src/pkg/runtime/pprof/pprof.go b/src/pkg/runtime/pprof/pprof.go index 9808045..26aa0b8 100644 --- a/src/pkg/runtime/pprof/pprof.go +++ b/src/pkg/runtime/pprof/pprof.go
@@ -20,7 +20,7 @@ "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. // A Profile is a collection of stack traces showing the call sequences
diff --git a/src/pkg/sort/sort.go b/src/pkg/sort/sort.go index 242c5ff..e980c29 100644 --- a/src/pkg/sort/sort.go +++ b/src/pkg/sort/sort.go
@@ -287,7 +287,7 @@ // Notes on stable sorting: // The used algorithms are simple and provable correct on all input and use // 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: // - GCC's 4.6.3 stable_sort with merge_without_buffer from libstdc++:
diff --git a/src/pkg/syscall/dir_plan9.go b/src/pkg/syscall/dir_plan9.go index d9fb26b..697bf54 100644 --- a/src/pkg/syscall/dir_plan9.go +++ b/src/pkg/syscall/dir_plan9.go
@@ -54,7 +54,7 @@ } // 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 } // Marshal encodes a 9P stat message corresponding to d into b
diff --git a/src/pkg/syscall/fd_nacl.go b/src/pkg/syscall/fd_nacl.go index cbc8315..19cd98a 100644 --- a/src/pkg/syscall/fd_nacl.go +++ b/src/pkg/syscall/fd_nacl.go
@@ -194,7 +194,7 @@ return f.impl.seek(offset, whence) } -// defaulFileImpl imlements fileImpl. +// defaulFileImpl implements fileImpl. // It can be embedded to complete a partial fileImpl implementation. type defaultFileImpl struct{}
diff --git a/src/pkg/syscall/mksyscall_windows.go b/src/pkg/syscall/mksyscall_windows.go index 0fd1c3c..4225588 100644 --- a/src/pkg/syscall/mksyscall_windows.go +++ b/src/pkg/syscall/mksyscall_windows.go
@@ -135,7 +135,7 @@ } // 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. func (p *Param) SyscallArgList() []string { var s string @@ -321,7 +321,7 @@ // extractSection extracts text out of string s starting after start // 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) { s = trim(s) if strings.HasPrefix(s, string(start)) { @@ -617,7 +617,7 @@ } } -// TODO: use println instead to print in the folowing template +// TODO: use println instead to print in the following template const srcTemplate = ` {{define "main"}}// go build mksyscall_windows.go && ./mksyscall_windows{{range .Files}} {{.}}{{end}}
diff --git a/src/pkg/syscall/route_dragonfly.go b/src/pkg/syscall/route_dragonfly.go index acad7a2b..79190d2 100644 --- a/src/pkg/syscall/route_dragonfly.go +++ b/src/pkg/syscall/route_dragonfly.go
@@ -30,7 +30,7 @@ } // InterfaceAnnounceMessage represents a routing message containing -// network interface arrival and depature information. +// network interface arrival and departure information. type InterfaceAnnounceMessage struct { Header IfAnnounceMsghdr }
diff --git a/src/pkg/syscall/route_freebsd.go b/src/pkg/syscall/route_freebsd.go index eba6752..15897b1 100644 --- a/src/pkg/syscall/route_freebsd.go +++ b/src/pkg/syscall/route_freebsd.go
@@ -36,7 +36,7 @@ } // InterfaceAnnounceMessage represents a routing message containing -// network interface arrival and depature information. +// network interface arrival and departure information. type InterfaceAnnounceMessage struct { Header IfAnnounceMsghdr }
diff --git a/src/pkg/syscall/route_netbsd.go b/src/pkg/syscall/route_netbsd.go index a6baa02..9883aeb 100644 --- a/src/pkg/syscall/route_netbsd.go +++ b/src/pkg/syscall/route_netbsd.go
@@ -27,7 +27,7 @@ } // InterfaceAnnounceMessage represents a routing message containing -// network interface arrival and depature information. +// network interface arrival and departure information. type InterfaceAnnounceMessage struct { Header IfAnnounceMsghdr }
diff --git a/src/pkg/syscall/route_openbsd.go b/src/pkg/syscall/route_openbsd.go index 223c157..19f902d 100644 --- a/src/pkg/syscall/route_openbsd.go +++ b/src/pkg/syscall/route_openbsd.go
@@ -27,7 +27,7 @@ } // InterfaceAnnounceMessage represents a routing message containing -// network interface arrival and depature information. +// network interface arrival and departure information. type InterfaceAnnounceMessage struct { Header IfAnnounceMsghdr }
diff --git a/src/pkg/time/zoneinfo_windows.go b/src/pkg/time/zoneinfo_windows.go index 377a892..6046743 100644 --- a/src/pkg/time/zoneinfo_windows.go +++ b/src/pkg/time/zoneinfo_windows.go
@@ -90,7 +90,7 @@ 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 { var short []rune for _, c := range desc {