mirror of
https://github.com/golang/go
synced 2024-11-26 16:57:14 -07:00
all: fix article typos
a -> an Change-Id: I7362bdc199e83073a712be657f5d9ba16df3077e Reviewed-on: https://go-review.googlesource.com/63850 Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
33cb1481f2
commit
5a986eca86
@ -94,7 +94,7 @@ func (z *Reader) init(r io.ReaderAt, size int64) error {
|
|||||||
|
|
||||||
// The count of files inside a zip is truncated to fit in a uint16.
|
// The count of files inside a zip is truncated to fit in a uint16.
|
||||||
// Gloss over this by reading headers until we encounter
|
// Gloss over this by reading headers until we encounter
|
||||||
// a bad one, and then only report a ErrFormat or UnexpectedEOF if
|
// a bad one, and then only report an ErrFormat or UnexpectedEOF if
|
||||||
// the file count modulo 65536 is incorrect.
|
// the file count modulo 65536 is incorrect.
|
||||||
for {
|
for {
|
||||||
f := &File{zip: z, zipr: r, zipsize: size}
|
f := &File{zip: z, zipr: r, zipsize: size}
|
||||||
|
@ -106,7 +106,7 @@ func (n *Name) IsConst() bool {
|
|||||||
return strings.HasSuffix(n.Kind, "const")
|
return strings.HasSuffix(n.Kind, "const")
|
||||||
}
|
}
|
||||||
|
|
||||||
// A ExpFunc is an exported function, callable from C.
|
// An ExpFunc is an exported function, callable from C.
|
||||||
// Such functions are identified in the Go input file
|
// Such functions are identified in the Go input file
|
||||||
// by doc comments containing the line //export ExpName
|
// by doc comments containing the line //export ExpName
|
||||||
type ExpFunc struct {
|
type ExpFunc struct {
|
||||||
|
@ -1767,7 +1767,7 @@ func ascompatee1(l *Node, r *Node, init *Nodes) *Node {
|
|||||||
|
|
||||||
func ascompatee(op Op, nl, nr []*Node, init *Nodes) []*Node {
|
func ascompatee(op Op, nl, nr []*Node, init *Nodes) []*Node {
|
||||||
// check assign expression list to
|
// check assign expression list to
|
||||||
// a expression list. called in
|
// an expression list. called in
|
||||||
// expr-list = expr-list
|
// expr-list = expr-list
|
||||||
|
|
||||||
// ensure order of evaluation for function calls
|
// ensure order of evaluation for function calls
|
||||||
@ -1819,7 +1819,7 @@ func fncall(l *Node, rt *types.Type) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check assign type list to
|
// check assign type list to
|
||||||
// a expression list. called in
|
// an expression list. called in
|
||||||
// expr-list = func()
|
// expr-list = func()
|
||||||
func ascompatet(nl Nodes, nr *types.Type) []*Node {
|
func ascompatet(nl Nodes, nr *types.Type) []*Node {
|
||||||
if nl.Len() != nr.NumFields() {
|
if nl.Len() != nr.NumFields() {
|
||||||
|
@ -17,7 +17,7 @@ type edgeMem struct {
|
|||||||
m *Value // phi for memory at dest of e
|
m *Value // phi for memory at dest of e
|
||||||
}
|
}
|
||||||
|
|
||||||
// a rewriteTarget is a a value-argindex pair indicating
|
// a rewriteTarget is a value-argindex pair indicating
|
||||||
// where a rewrite is applied. Note that this is for values,
|
// where a rewrite is applied. Note that this is for values,
|
||||||
// not for block controls, because block controls are not targets
|
// not for block controls, because block controls are not targets
|
||||||
// for the rewrites performed in inserting rescheduling checks.
|
// for the rewrites performed in inserting rescheduling checks.
|
||||||
|
@ -632,7 +632,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
|
|||||||
// B end
|
// B end
|
||||||
//
|
//
|
||||||
// The NOP is needed to give the jumps somewhere to land.
|
// The NOP is needed to give the jumps somewhere to land.
|
||||||
// It is a liblink NOP, not a ARM64 NOP: it encodes to 0 instruction bytes.
|
// It is a liblink NOP, not an ARM64 NOP: it encodes to 0 instruction bytes.
|
||||||
q = q1
|
q = q1
|
||||||
|
|
||||||
// MOV g_panic(g), R1
|
// MOV g_panic(g), R1
|
||||||
|
@ -123,7 +123,7 @@ func getattr(die *dwarf.DWDie, attr uint16) *dwarf.DWAttr {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Every DIE has at least a AT_name attribute (but it will only be
|
// Every DIE has at least an AT_name attribute (but it will only be
|
||||||
// written out if it is listed in the abbrev).
|
// written out if it is listed in the abbrev).
|
||||||
func newdie(ctxt *Link, parent *dwarf.DWDie, abbrev int, name string, version int) *dwarf.DWDie {
|
func newdie(ctxt *Link, parent *dwarf.DWDie, abbrev int, name string, version int) *dwarf.DWDie {
|
||||||
die := new(dwarf.DWDie)
|
die := new(dwarf.DWDie)
|
||||||
|
@ -66,7 +66,7 @@ type Header struct {
|
|||||||
// Only the first header is recorded in the Reader fields.
|
// Only the first header is recorded in the Reader fields.
|
||||||
//
|
//
|
||||||
// Gzip files store a length and checksum of the uncompressed data.
|
// Gzip files store a length and checksum of the uncompressed data.
|
||||||
// The Reader will return a ErrChecksum when Read
|
// The Reader will return an ErrChecksum when Read
|
||||||
// reaches the end of the uncompressed data if it does not
|
// reaches the end of the uncompressed data if it does not
|
||||||
// have the expected length or checksum. Clients should treat data
|
// have the expected length or checksum. Clients should treat data
|
||||||
// returned by Read as tentative until they receive the io.EOF
|
// returned by Read as tentative until they receive the io.EOF
|
||||||
|
@ -52,7 +52,7 @@ func ExampleWithCancel() {
|
|||||||
// 5
|
// 5
|
||||||
}
|
}
|
||||||
|
|
||||||
// This example passes a context with a arbitrary deadline to tell a blocking
|
// This example passes a context with an arbitrary deadline to tell a blocking
|
||||||
// function that it should abandon its work as soon as it gets to it.
|
// function that it should abandon its work as soon as it gets to it.
|
||||||
func ExampleWithDeadline() {
|
func ExampleWithDeadline() {
|
||||||
d := time.Now().Add(50 * time.Millisecond)
|
d := time.Now().Add(50 * time.Millisecond)
|
||||||
|
@ -37,7 +37,7 @@ type PrivateKey struct {
|
|||||||
// this error must be handled.
|
// this error must be handled.
|
||||||
var ErrInvalidPublicKey = errors.New("crypto/dsa: invalid public key")
|
var ErrInvalidPublicKey = errors.New("crypto/dsa: invalid public key")
|
||||||
|
|
||||||
// ParameterSizes is a enumeration of the acceptable bit lengths of the primes
|
// ParameterSizes is an enumeration of the acceptable bit lengths of the primes
|
||||||
// in a set of DSA parameters. See FIPS 186-3, section 4.2.
|
// in a set of DSA parameters. See FIPS 186-3, section 4.2.
|
||||||
type ParameterSizes int
|
type ParameterSizes int
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ type PublicKey struct {
|
|||||||
X, Y *big.Int
|
X, Y *big.Int
|
||||||
}
|
}
|
||||||
|
|
||||||
// PrivateKey represents a ECDSA private key.
|
// PrivateKey represents an ECDSA private key.
|
||||||
type PrivateKey struct {
|
type PrivateKey struct {
|
||||||
PublicKey
|
PublicKey
|
||||||
D *big.Int
|
D *big.Int
|
||||||
|
@ -172,7 +172,7 @@ func curveForCurveID(id CurveID) (elliptic.Curve, bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ecdheRSAKeyAgreement implements a TLS key agreement where the server
|
// ecdheRSAKeyAgreement implements a TLS key agreement where the server
|
||||||
// generates a ephemeral EC public/private key pair and signs it. The
|
// generates an ephemeral EC public/private key pair and signs it. The
|
||||||
// pre-master secret is then calculated using ECDH. The signature may
|
// pre-master secret is then calculated using ECDH. The signature may
|
||||||
// either be ECDSA or RSA.
|
// either be ECDSA or RSA.
|
||||||
type ecdheKeyAgreement struct {
|
type ecdheKeyAgreement struct {
|
||||||
|
@ -374,7 +374,7 @@ func parseGeneralizedTime(bytes []byte) (ret time.Time, err error) {
|
|||||||
|
|
||||||
// PrintableString
|
// PrintableString
|
||||||
|
|
||||||
// parsePrintableString parses a ASN.1 PrintableString from the given byte
|
// parsePrintableString parses an ASN.1 PrintableString from the given byte
|
||||||
// array and returns it.
|
// array and returns it.
|
||||||
func parsePrintableString(bytes []byte) (ret string, err error) {
|
func parsePrintableString(bytes []byte) (ret string, err error) {
|
||||||
for _, b := range bytes {
|
for _, b := range bytes {
|
||||||
@ -406,7 +406,7 @@ func isPrintable(b byte) bool {
|
|||||||
|
|
||||||
// IA5String
|
// IA5String
|
||||||
|
|
||||||
// parseIA5String parses a ASN.1 IA5String (ASCII string) from the given
|
// parseIA5String parses an ASN.1 IA5String (ASCII string) from the given
|
||||||
// byte slice and returns it.
|
// byte slice and returns it.
|
||||||
func parseIA5String(bytes []byte) (ret string, err error) {
|
func parseIA5String(bytes []byte) (ret string, err error) {
|
||||||
for _, b := range bytes {
|
for _, b := range bytes {
|
||||||
@ -421,7 +421,7 @@ func parseIA5String(bytes []byte) (ret string, err error) {
|
|||||||
|
|
||||||
// T61String
|
// T61String
|
||||||
|
|
||||||
// parseT61String parses a ASN.1 T61String (8-bit clean string) from the given
|
// parseT61String parses an ASN.1 T61String (8-bit clean string) from the given
|
||||||
// byte slice and returns it.
|
// byte slice and returns it.
|
||||||
func parseT61String(bytes []byte) (ret string, err error) {
|
func parseT61String(bytes []byte) (ret string, err error) {
|
||||||
return string(bytes), nil
|
return string(bytes), nil
|
||||||
@ -429,7 +429,7 @@ func parseT61String(bytes []byte) (ret string, err error) {
|
|||||||
|
|
||||||
// UTF8String
|
// UTF8String
|
||||||
|
|
||||||
// parseUTF8String parses a ASN.1 UTF8String (raw UTF-8) from the given byte
|
// parseUTF8String parses an ASN.1 UTF8String (raw UTF-8) from the given byte
|
||||||
// array and returns it.
|
// array and returns it.
|
||||||
func parseUTF8String(bytes []byte) (ret string, err error) {
|
func parseUTF8String(bytes []byte) (ret string, err error) {
|
||||||
if !utf8.Valid(bytes) {
|
if !utf8.Valid(bytes) {
|
||||||
@ -992,7 +992,7 @@ func setDefaultValue(v reflect.Value, params fieldParameters) (ok bool) {
|
|||||||
//
|
//
|
||||||
// The following tags on struct fields have special meaning to Unmarshal:
|
// The following tags on struct fields have special meaning to Unmarshal:
|
||||||
//
|
//
|
||||||
// application specifies that a APPLICATION tag is used
|
// application specifies that an APPLICATION tag is used
|
||||||
// default:x sets the default value for optional integer fields (only used if optional is also present)
|
// default:x sets the default value for optional integer fields (only used if optional is also present)
|
||||||
// explicit specifies that an additional, explicit tag wraps the implicit one
|
// explicit specifies that an additional, explicit tag wraps the implicit one
|
||||||
// optional marks the field as ASN.1 OPTIONAL
|
// optional marks the field as ASN.1 OPTIONAL
|
||||||
|
@ -18,7 +18,7 @@ var (
|
|||||||
byteFFEncoder encoder = byteEncoder(0xff)
|
byteFFEncoder encoder = byteEncoder(0xff)
|
||||||
)
|
)
|
||||||
|
|
||||||
// encoder represents a ASN.1 element that is waiting to be marshaled.
|
// encoder represents an ASN.1 element that is waiting to be marshaled.
|
||||||
type encoder interface {
|
type encoder interface {
|
||||||
// Len returns the number of bytes needed to marshal this element.
|
// Len returns the number of bytes needed to marshal this element.
|
||||||
Len() int
|
Len() int
|
||||||
|
@ -200,7 +200,7 @@ func nrgbaModel(c Color) Color {
|
|||||||
if a == 0 {
|
if a == 0 {
|
||||||
return NRGBA{0, 0, 0, 0}
|
return NRGBA{0, 0, 0, 0}
|
||||||
}
|
}
|
||||||
// Since Color.RGBA returns a alpha-premultiplied color, we should have r <= a && g <= a && b <= a.
|
// Since Color.RGBA returns an alpha-premultiplied color, we should have r <= a && g <= a && b <= a.
|
||||||
r = (r * 0xffff) / a
|
r = (r * 0xffff) / a
|
||||||
g = (g * 0xffff) / a
|
g = (g * 0xffff) / a
|
||||||
b = (b * 0xffff) / a
|
b = (b * 0xffff) / a
|
||||||
@ -218,7 +218,7 @@ func nrgba64Model(c Color) Color {
|
|||||||
if a == 0 {
|
if a == 0 {
|
||||||
return NRGBA64{0, 0, 0, 0}
|
return NRGBA64{0, 0, 0, 0}
|
||||||
}
|
}
|
||||||
// Since Color.RGBA returns a alpha-premultiplied color, we should have r <= a && g <= a && b <= a.
|
// Since Color.RGBA returns an alpha-premultiplied color, we should have r <= a && g <= a && b <= a.
|
||||||
r = (r * 0xffff) / a
|
r = (r * 0xffff) / a
|
||||||
g = (g * 0xffff) / a
|
g = (g * 0xffff) / a
|
||||||
b = (b * 0xffff) / a
|
b = (b * 0xffff) / a
|
||||||
|
@ -1213,7 +1213,7 @@ func (cw *chunkWriter) writeHeader(p []byte) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for a explicit (and valid) Content-Length header.
|
// Check for an explicit (and valid) Content-Length header.
|
||||||
hasCL := w.contentLength != -1
|
hasCL := w.contentLength != -1
|
||||||
|
|
||||||
if w.wants10KeepAlive && (isHEAD || hasCL || !bodyAllowedForStatus(w.status)) {
|
if w.wants10KeepAlive && (isHEAD || hasCL || !bodyAllowedForStatus(w.status)) {
|
||||||
|
@ -24,7 +24,7 @@ func hostname() (name string, err error) {
|
|||||||
return "", NewSyscallError("ComputerNameEx", err)
|
return "", NewSyscallError("ComputerNameEx", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we received a ERROR_MORE_DATA, but n doesn't get larger,
|
// If we received an ERROR_MORE_DATA, but n doesn't get larger,
|
||||||
// something has gone wrong and we may be in an infinite loop
|
// something has gone wrong and we may be in an infinite loop
|
||||||
if n <= uint32(len(b)) {
|
if n <= uint32(len(b)) {
|
||||||
return "", NewSyscallError("ComputerNameEx", err)
|
return "", NewSyscallError("ComputerNameEx", err)
|
||||||
|
@ -176,7 +176,7 @@ type emptyInterface struct {
|
|||||||
word unsafe.Pointer
|
word unsafe.Pointer
|
||||||
}
|
}
|
||||||
|
|
||||||
// nonEmptyInterface is the header for a interface value with methods.
|
// nonEmptyInterface is the header for an interface value with methods.
|
||||||
type nonEmptyInterface struct {
|
type nonEmptyInterface struct {
|
||||||
// see ../runtime/iface.go:/Itab
|
// see ../runtime/iface.go:/Itab
|
||||||
itab *struct {
|
itab *struct {
|
||||||
|
@ -16,7 +16,7 @@ type queue struct {
|
|||||||
dense []entry
|
dense []entry
|
||||||
}
|
}
|
||||||
|
|
||||||
// A entry is an entry on a queue.
|
// An entry is an entry on a queue.
|
||||||
// It holds both the instruction pc and the actual thread.
|
// It holds both the instruction pc and the actual thread.
|
||||||
// Some queue entries are just place holders so that the machine
|
// Some queue entries are just place holders so that the machine
|
||||||
// knows it has considered that pc. Such entries have t == nil.
|
// knows it has considered that pc. Such entries have t == nil.
|
||||||
|
@ -340,7 +340,7 @@ func unwindm(restore *bool) {
|
|||||||
// Call endcgo to do the accounting that cgocall will not have a
|
// Call endcgo to do the accounting that cgocall will not have a
|
||||||
// chance to do during an unwind.
|
// chance to do during an unwind.
|
||||||
//
|
//
|
||||||
// In the case where a a Go call originates from C, ncgo is 0
|
// In the case where a Go call originates from C, ncgo is 0
|
||||||
// and there is no matching cgocall to end.
|
// and there is no matching cgocall to end.
|
||||||
if mp.ncgo > 0 {
|
if mp.ncgo > 0 {
|
||||||
endcgo(mp)
|
endcgo(mp)
|
||||||
|
@ -863,7 +863,7 @@ HaveSpan:
|
|||||||
// Large spans have a minimum size of 1MByte. The maximum number of large spans to support
|
// Large spans have a minimum size of 1MByte. The maximum number of large spans to support
|
||||||
// 1TBytes is 1 million, experimentation using random sizes indicates that the depth of
|
// 1TBytes is 1 million, experimentation using random sizes indicates that the depth of
|
||||||
// the tree is less that 2x that of a perfectly balanced tree. For 1TByte can be referenced
|
// the tree is less that 2x that of a perfectly balanced tree. For 1TByte can be referenced
|
||||||
// by a perfectly balanced tree with a a depth of 20. Twice that is an acceptable 40.
|
// by a perfectly balanced tree with a depth of 20. Twice that is an acceptable 40.
|
||||||
func (h *mheap) isLargeSpan(npages uintptr) bool {
|
func (h *mheap) isLargeSpan(npages uintptr) bool {
|
||||||
return npages >= uintptr(len(h.free))
|
return npages >= uintptr(len(h.free))
|
||||||
}
|
}
|
||||||
|
@ -641,7 +641,7 @@ func (f *extFloat) ShortestDecimal(d *decimalSlice, lower, upper *extFloat) bool
|
|||||||
// adjustLastDigit modifies d = x-currentDiff*ε, to get closest to
|
// adjustLastDigit modifies d = x-currentDiff*ε, to get closest to
|
||||||
// d = x-targetDiff*ε, without becoming smaller than x-maxDiff*ε.
|
// d = x-targetDiff*ε, without becoming smaller than x-maxDiff*ε.
|
||||||
// It assumes that a decimal digit is worth ulpDecimal*ε, and that
|
// It assumes that a decimal digit is worth ulpDecimal*ε, and that
|
||||||
// all data is known with a error estimate of ulpBinary*ε.
|
// all data is known with an error estimate of ulpBinary*ε.
|
||||||
func adjustLastDigit(d *decimalSlice, currentDiff, targetDiff, maxDiff, ulpDecimal, ulpBinary uint64) bool {
|
func adjustLastDigit(d *decimalSlice, currentDiff, targetDiff, maxDiff, ulpDecimal, ulpBinary uint64) bool {
|
||||||
if ulpDecimal < 2*ulpBinary {
|
if ulpDecimal < 2*ulpBinary {
|
||||||
// Approximation is too wide.
|
// Approximation is too wide.
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
// Test various parsing cases that are a little
|
// Test various parsing cases that are a little
|
||||||
// different now that send is a statement, not a expression.
|
// different now that send is a statement, not an expression.
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
// Issue 15747: If a ODCL is dropped, for example when inlining,
|
// Issue 15747: If an ODCL is dropped, for example when inlining,
|
||||||
// then it's easy to end up not initializing the '&x' pseudo-variable
|
// then it's easy to end up not initializing the '&x' pseudo-variable
|
||||||
// to point to an actual allocation. The liveness analysis will detect
|
// to point to an actual allocation. The liveness analysis will detect
|
||||||
// this and abort the computation, so this test just checks that the
|
// this and abort the computation, so this test just checks that the
|
||||||
|
Loading…
Reference in New Issue
Block a user