]> Cypherpunks repositories - gostls13.git/commitdiff
all: be more idiomatic when documenting boolean return values.
authorRob Pike <r@golang.org>
Tue, 23 Jul 2013 01:59:49 +0000 (11:59 +1000)
committerRob Pike <r@golang.org>
Tue, 23 Jul 2013 01:59:49 +0000 (11:59 +1000)
Phrases like "returns whether or not the image is opaque" could be
describing what the function does (it always returns, regardless of
the opacity) or what it returns (a boolean indicating the opacity).
Even when the "or not" is missing, the phrasing is bizarre.

Go with "reports whether", which is still clunky but at least makes
it clear we're talking about the return value.

These were edited by hand. A few were cleaned up in other ways.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/11699043

45 files changed:
doc/play/life.go
src/cmd/dist/plan9.c
src/cmd/dist/unix.c
src/cmd/dist/windows.c
src/cmd/gc/export.c
src/cmd/gc/subr.c
src/cmd/go/pkg.go
src/pkg/bufio/scan.go
src/pkg/bytes/bytes.go
src/pkg/crypto/ecdsa/ecdsa.go
src/pkg/crypto/x509/pkix/pkix.go
src/pkg/debug/gosym/symtab.go
src/pkg/encoding/asn1/asn1.go
src/pkg/encoding/gob/encode.go
src/pkg/encoding/json/tags.go
src/pkg/flag/flag.go
src/pkg/fmt/print.go
src/pkg/go/ast/ast.go
src/pkg/go/doc/testdata/testing.0.golden
src/pkg/go/doc/testdata/testing.1.golden
src/pkg/go/doc/testdata/testing.2.golden
src/pkg/go/doc/testdata/testing.go
src/pkg/html/template/context.go
src/pkg/html/template/css.go
src/pkg/html/template/escape.go
src/pkg/html/template/js.go
src/pkg/html/template/transition.go
src/pkg/image/format.go
src/pkg/image/geom.go
src/pkg/image/image.go
src/pkg/image/jpeg/dct_test.go
src/pkg/image/names.go
src/pkg/math/bits.go
src/pkg/mime/multipart/multipart.go
src/pkg/net/http/cookiejar/jar.go
src/pkg/net/http/header.go
src/pkg/net/http/request.go
src/pkg/net/http/response.go
src/pkg/net/http/server.go
src/pkg/net/http/transfer.go
src/pkg/os/doc.go
src/pkg/os/error.go
src/pkg/regexp/regexp.go
src/pkg/sort/sort.go
src/pkg/text/template/exec.go

index 08271761c5f9011906311b21626193b980873b26..51afb61f3dea979f35983dbf8c26b685e67c8184 100644 (file)
@@ -28,7 +28,7 @@ func (f *Field) Set(x, y int, b bool) {
        f.s[y][x] = b
 }
 
-// Alive returns whether the specified cell is alive.
+// Alive reports whether the specified cell is alive.
 // If the x or y coordinates are outside the field boundaries they are wrapped
 // toroidally. For instance, an x value of -1 is treated as width-1.
 func (f *Field) Alive(x, y int) bool {
index d954cb35a2c81d0990ca1db12d65de067d605c1a..8d492ebc67ca2d92330072a9bfe78f3a5b2517cd 100644 (file)
@@ -736,7 +736,7 @@ xstrrchr(char *p, int c)
        return strrchr(p, c);
 }
 
-// xsamefile returns whether f1 and f2 are the same file (or dir)
+// xsamefile reports whether f1 and f2 are the same file (or dir)
 int
 xsamefile(char *f1, char *f2)
 {
index 3ab40f1b51fb686b83944483553f198372689d00..fbb3a70ccd359b5e53d38985e4146d296e529073 100644 (file)
@@ -747,7 +747,7 @@ xstrrchr(char *p, int c)
        return strrchr(p, c);
 }
 
-// xsamefile returns whether f1 and f2 are the same file (or dir)
+// xsamefile reports whether f1 and f2 are the same file (or dir)
 int
 xsamefile(char *f1, char *f2)
 {
index ba23a7ae82814625a11d0321a9fc8024c656963c..75f7896eb7bba6ecd588d51f38c6fe14b8a4e58c 100644 (file)
@@ -929,7 +929,7 @@ xstrrchr(char *p, int c)
        return nil;
 }
 
-// xsamefile returns whether f1 and f2 are the same file (or dir)
+// xsamefile reports whether f1 and f2 are the same file (or dir)
 int
 xsamefile(char *f1, char *f2)
 {
index caac330d52dcca0ba3e90e680e9c6c9bd6a87b2a..ece02bc3bd02ff2df6a4cca3afde26fc02216ca2 100644 (file)
@@ -44,7 +44,7 @@ initname(char *s)
        return strcmp(s, "init") == 0;
 }
 
-// exportedsym returns whether a symbol will be visible
+// exportedsym reports whether a symbol will be visible
 // to files that import our package.
 static int
 exportedsym(Sym *sym)
index 3b1b0543e09fbfc2072e4c7783481386c3aba525..d828c784b09758f63000074d06746a2aa3c9bc62 100644 (file)
@@ -525,7 +525,7 @@ saveorignode(Node *n)
        n->orig = norig;
 }
 
-// ispaddedfield returns whether the given field
+// ispaddedfield reports whether the given field
 // is followed by padding. For the case where t is
 // the last field, total gives the size of the enclosing struct.
 static int
index 31e6da6d3451c71b48e55d37a566ddcfd804f583..3c7b84419782523c294a44edc259808430f6a1c0 100644 (file)
@@ -492,12 +492,12 @@ func (p *Package) load(stk *importStack, bp *build.Package, err error) *Package
        return p
 }
 
-// usesSwig returns whether the package needs to run SWIG.
+// usesSwig reports whether the package needs to run SWIG.
 func (p *Package) usesSwig() bool {
        return len(p.SwigFiles) > 0 || len(p.SwigCXXFiles) > 0
 }
 
-// usesCgo returns whether the package needs to run cgo
+// usesCgo reports whether the package needs to run cgo
 func (p *Package) usesCgo() bool {
        return len(p.CgoFiles) > 0
 }
index 537a6db05844681bb0ecdad9922079bf32434da2..423505fbcbbb232219c4b927a024d92ebba44a7a 100644 (file)
@@ -287,7 +287,7 @@ func ScanLines(data []byte, atEOF bool) (advance int, token []byte, err error) {
        return 0, nil, nil
 }
 
-// isSpace returns whether the character is a Unicode white space character.
+// isSpace reports whether the character is a Unicode white space character.
 // We avoid dependency on the unicode package, but check validity of the implementation
 // in the tests.
 func isSpace(r rune) bool {
index b07902579c8ed4a41cac1eaa295ba9b245876a43..405b10a1dbf00083ace24115697986774395ce04 100644 (file)
@@ -77,7 +77,7 @@ func Count(s, sep []byte) int {
        return count
 }
 
-// Contains returns whether subslice is within b.
+// Contains reports whether subslice is within b.
 func Contains(b, subslice []byte) bool {
        return Index(b, subslice) != -1
 }
index f642cb9ab777586c2ee6b28186bef598625d9935..d02f15c34d9ab8eab9f2016e6a011c052eec6211 100644 (file)
@@ -123,8 +123,8 @@ func Sign(rand io.Reader, priv *PrivateKey, hash []byte) (r, s *big.Int, err err
        return
 }
 
-// Verify verifies the signature in r, s of hash using the public key, pub. It
-// returns whether the signature is valid.
+// Verify verifies the signature in r, s of hash using the public key, pub. Its
+// return value records whether the signature is valid.
 func Verify(pub *PublicKey, hash []byte, r, s *big.Int) bool {
        // See [NSA] 3.4.2
        c := pub.Curve
index 2c600aee3ac9fe3c9c1362cfe3721e4dc44ed459..5034946f7103d38af2d6ba3d57ab1c47fbf5f7b2 100644 (file)
@@ -144,7 +144,7 @@ type CertificateList struct {
        SignatureValue     asn1.BitString
 }
 
-// HasExpired returns whether now is past the expiry time of certList.
+// HasExpired reports whether now is past the expiry time of certList.
 func (certList *CertificateList) HasExpired(now time.Time) bool {
        return now.After(certList.TBSCertList.NextUpdate)
 }
index 6a60b51e37a10faa34cd01d120e26c588a87b013..9ab05bac2f70af17e9edb7417956eb56e196f8df 100644 (file)
@@ -34,7 +34,7 @@ type Sym struct {
        Func *Func
 }
 
-// Static returns whether this symbol is static (not visible outside its file).
+// Static reports whether this symbol is static (not visible outside its file).
 func (s *Sym) Static() bool { return s.Type >= 'a' }
 
 // PackageName returns the package part of the symbol name,
index c53430850db770448d3c9aad4fadea5bfa59a2a5..992356c263bce00537cddadc59a506349d56f0e4 100644 (file)
@@ -183,7 +183,7 @@ func parseBitString(bytes []byte) (ret BitString, err error) {
 // An ObjectIdentifier represents an ASN.1 OBJECT IDENTIFIER.
 type ObjectIdentifier []int
 
-// Equal returns whether oi and other represent the same identifier.
+// Equal reports whether oi and other represent the same identifier.
 func (oi ObjectIdentifier) Equal(other ObjectIdentifier) bool {
        if len(oi) != len(other) {
                return false
index 2726bcd7e713a51f52dc840c8b045af6355a6f57..ee9b0783e098f9100e6eeec95780aa28b926de7b 100644 (file)
@@ -474,7 +474,7 @@ func (enc *Encoder) encodeInterface(b *bytes.Buffer, iv reflect.Value) {
        enc.freeEncoderState(state)
 }
 
-// isZero returns whether the value is the zero of its type.
+// isZero reports whether the value is the zero of its type.
 func isZero(val reflect.Value) bool {
        switch val.Kind() {
        case reflect.Array:
index 58cda2027c612ae107dad951bbf0eb3a81d07879..c38fd5102f6302deb1e10639dbe4552ee255837e 100644 (file)
@@ -21,7 +21,7 @@ func parseTag(tag string) (string, tagOptions) {
        return tag, tagOptions("")
 }
 
-// Contains returns whether checks that a comma-separated list of options
+// Contains reports whether a comma-separated list of options
 // contains a particular substr flag. substr must be surrounded by a
 // string boundary or commas.
 func (o tagOptions) Contains(optionName string) bool {
index c6bb1f0633d001c199d2025cff42740b758d555a..bde055d3bd4a3d98f5de6da4870873330694b230 100644 (file)
@@ -699,7 +699,7 @@ func (f *FlagSet) usage() {
        }
 }
 
-// parseOne parses one flag. It returns whether a flag was seen.
+// parseOne parses one flag. It reports whether a flag was seen.
 func (f *FlagSet) parseOne() (bool, error) {
        if len(f.args) == 0 {
                return false, nil
index 2da95b58afaae9ce284cb48686e11d2d9373a55e..fd37b5ac64085ba2dacf7ebf2810250247c08483 100644 (file)
@@ -43,7 +43,7 @@ type State interface {
        // Precision returns the value of the precision option and whether it has been set.
        Precision() (prec int, ok bool)
 
-       // Flag returns whether the flag c, a character, has been set.
+       // Flag reports whether the flag c, a character, has been set.
        Flag(c int) bool
 }
 
index efa0f0493621f20bbe537966cbee690fe04200fc..e7e357106c7836487c78edd4b230b28b37953c49 100644 (file)
@@ -519,15 +519,15 @@ func (*ChanType) exprNode()      {}
 //
 func NewIdent(name string) *Ident { return &Ident{token.NoPos, name, nil} }
 
-// IsExported returns whether name is an exported Go symbol
-// (i.e., whether it begins with an uppercase letter).
+// IsExported reports whether name is an exported Go symbol
+// (that is, whether it begins with an upper-case letter).
 //
 func IsExported(name string) bool {
        ch, _ := utf8.DecodeRuneInString(name)
        return unicode.IsUpper(ch)
 }
 
-// IsExported returns whether id is an exported Go symbol
+// IsExported reports whether id is an exported Go symbol
 // (i.e., whether it begins with an uppercase letter).
 //
 func (id *Ident) IsExported() bool { return IsExported(id.Name) }
index 15a90398664c504dab7ecfa89c143e8cc2516ac1..f8348f1ac34a493cc0d43d834cc0f215f85fce5a 100644 (file)
@@ -57,7 +57,7 @@ TYPES
        // FailNow marks the function as having failed and stops its ...
        func (c *B) FailNow()
 
-       // Failed returns whether the function has failed. 
+       // Failed reports whether the function has failed. 
        func (c *B) Failed() bool
 
        // Fatal is equivalent to Log() followed by FailNow(). 
@@ -136,7 +136,7 @@ TYPES
        // FailNow marks the function as having failed and stops its ...
        func (c *T) FailNow()
 
-       // Failed returns whether the function has failed. 
+       // Failed reports whether the function has failed. 
        func (c *T) Failed() bool
 
        // Fatal is equivalent to Log() followed by FailNow(). 
index ffdb5c3b5887fbaae7c61282eec328617c9b95c1..282bb1015ad577d11d70e5cf08f53b36e37fa532 100644 (file)
@@ -130,7 +130,7 @@ TYPES
        // FailNow marks the function as having failed and stops its ...
        func (c *B) FailNow()
 
-       // Failed returns whether the function has failed. 
+       // Failed reports whether the function has failed. 
        func (c *B) Failed() bool
 
        // Fatal is equivalent to Log() followed by FailNow(). 
@@ -232,7 +232,7 @@ TYPES
        // FailNow marks the function as having failed and stops its ...
        func (c *T) FailNow()
 
-       // Failed returns whether the function has failed. 
+       // Failed reports whether the function has failed. 
        func (c *T) Failed() bool
 
        // Fatal is equivalent to Log() followed by FailNow(). 
@@ -278,7 +278,7 @@ TYPES
        // FailNow marks the function as having failed and stops its ...
        func (c *common) FailNow()
 
-       // Failed returns whether the function has failed. 
+       // Failed reports whether the function has failed. 
        func (c *common) Failed() bool
 
        // Fatal is equivalent to Log() followed by FailNow(). 
index 15a90398664c504dab7ecfa89c143e8cc2516ac1..f8348f1ac34a493cc0d43d834cc0f215f85fce5a 100644 (file)
@@ -57,7 +57,7 @@ TYPES
        // FailNow marks the function as having failed and stops its ...
        func (c *B) FailNow()
 
-       // Failed returns whether the function has failed. 
+       // Failed reports whether the function has failed. 
        func (c *B) Failed() bool
 
        // Fatal is equivalent to Log() followed by FailNow(). 
@@ -136,7 +136,7 @@ TYPES
        // FailNow marks the function as having failed and stops its ...
        func (c *T) FailNow()
 
-       // Failed returns whether the function has failed. 
+       // Failed reports whether the function has failed. 
        func (c *T) Failed() bool
 
        // Fatal is equivalent to Log() followed by FailNow(). 
index c2499ad77997b650e04b4dd27d7b3ee9206faa33..93ed494c32b166391532286fdd9067d0be03e8e6 100644 (file)
@@ -130,7 +130,7 @@ type T struct {
 // Fail marks the function as having failed but continues execution.
 func (c *common) Fail() { c.failed = true }
 
-// Failed returns whether the function has failed.
+// Failed reports whether the function has failed.
 func (c *common) Failed() bool { return c.failed }
 
 // FailNow marks the function as having failed and stops its execution.
index 7202221b831d8bc948f5874e8170eab09a30e396..eb47e2be3c79e3d932bf694d6d3d74588a6c1580 100644 (file)
@@ -29,7 +29,7 @@ func (c context) String() string {
        return fmt.Sprintf("{%v %v %v %v %v %v %v}", c.state, c.delim, c.urlPart, c.jsCtx, c.attr, c.element, c.err)
 }
 
-// eq returns whether two contexts are equal.
+// eq reports whether two contexts are equal.
 func (c context) eq(d context) bool {
        return c.state == d.state &&
                c.delim == d.delim &&
index 3bcd984983109fade7ce5a72920f30eeb7418aec..c5cb0743458397c8678106aa6854f543db85dc8c 100644 (file)
@@ -11,7 +11,7 @@ import (
        "unicode/utf8"
 )
 
-// endsWithCSSKeyword returns whether b ends with an ident that
+// endsWithCSSKeyword reports whether b ends with an ident that
 // case-insensitively matches the lower-case kw.
 func endsWithCSSKeyword(b []byte, kw string) bool {
        i := len(b) - len(kw)
@@ -34,7 +34,7 @@ func endsWithCSSKeyword(b []byte, kw string) bool {
        return string(bytes.ToLower(b[i:])) == kw
 }
 
-// isCSSNmchar returns whether rune is allowed anywhere in a CSS identifier.
+// isCSSNmchar reports whether rune is allowed anywhere in a CSS identifier.
 func isCSSNmchar(r rune) bool {
        // Based on the CSS3 nmchar production but ignores multi-rune escape
        // sequences.
@@ -99,7 +99,7 @@ func decodeCSS(s []byte) []byte {
        return b
 }
 
-// isHex returns whether the given character is a hex digit.
+// isHex reports reports whether the given character is a hex digit.
 func isHex(c byte) bool {
        return '0' <= c && c <= '9' || 'a' <= c && c <= 'f' || 'A' <= c && c <= 'F'
 }
@@ -144,7 +144,7 @@ func skipCSSSpace(c []byte) []byte {
        return c
 }
 
-// isCSSSpace returns whether b is a CSS space char as defined in wc.
+// isCSSSpace reports whether b is a CSS space char as defined in wc.
 func isCSSSpace(b byte) bool {
        switch b {
        case '\t', '\n', '\f', '\r', ' ':
index 4829bfcc438b106148a6a7b16baf6eb0153872e7..f2a4c8acaafd3f4ce3caad79c996c76ced9ddb12 100644 (file)
@@ -301,7 +301,7 @@ func indexOfStr(s string, strs []string, eq func(a, b string) bool) int {
        return -1
 }
 
-// escFnsEq returns whether the two escaping functions are equivalent.
+// escFnsEq reports whether the two escaping functions are equivalent.
 func escFnsEq(a, b string) bool {
        if e := equivEscapers[a]; e != "" {
                a = e
index a9740931fc2aaee247cb4986dc0bf8ac8dd2057f..d594e0ad7116b1fb8d97a4757edbbe6662396213 100644 (file)
@@ -341,7 +341,7 @@ var jsRegexpReplacementTable = []string{
        '}':  `\}`,
 }
 
-// isJSIdentPart returns whether the given rune is a JS identifier part.
+// isJSIdentPart reports whether the given rune is a JS identifier part.
 // It does not handle all the non-Latin letters, joiners, and combining marks,
 // but it does handle every codepoint that can occur in a numeric literal or
 // a keyword.
index 564eb202075fafd3d90dad5b99d27cb21fc3b09f..7f30a7ab8deb33609e3062e09bf820eb65a5d26b 100644 (file)
@@ -504,12 +504,12 @@ var elementNameMap = map[string]element{
        "title":    elementTitle,
 }
 
-// asciiAlpha returns whether c is an ASCII letter.
+// asciiAlpha reports whether c is an ASCII letter.
 func asciiAlpha(c byte) bool {
        return 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z'
 }
 
-// asciiAlphaNum returns whether c is an ASCII letter or digit.
+// asciiAlphaNum reports whether c is an ASCII letter or digit.
 func asciiAlphaNum(c byte) bool {
        return asciiAlpha(c) || '0' <= c && c <= '9'
 }
index 3040247f1f163a46f92248885a0c522f5ab6e232..3668de4e6858afdf4a1ffd2185bc980b96c996ff 100644 (file)
@@ -47,7 +47,7 @@ func asReader(r io.Reader) reader {
        return bufio.NewReader(r)
 }
 
-// Match returns whether magic matches b. Magic may contain "?" wildcards.
+// Match reports whether magic matches b. Magic may contain "?" wildcards.
 func match(magic string, b []byte) bool {
        if len(magic) != len(b) {
                return false
index e123483314c2e5148f7c6edec0db0030e8e1f423..6ebaf67da846d55d2297445ba62cf72f8511092f 100644 (file)
@@ -38,7 +38,7 @@ func (p Point) Div(k int) Point {
        return Point{p.X / k, p.Y / k}
 }
 
-// In returns whether p is in r.
+// In reports whether p is in r.
 func (p Point) In(r Rectangle) bool {
        return r.Min.X <= p.X && p.X < r.Max.X &&
                r.Min.Y <= p.Y && p.Y < r.Max.Y
@@ -60,7 +60,7 @@ func (p Point) Mod(r Rectangle) Point {
        return p.Add(r.Min)
 }
 
-// Eq returns whether p and q are equal.
+// Eq reports whether p and q are equal.
 func (p Point) Eq(q Point) bool {
        return p.X == q.X && p.Y == q.Y
 }
@@ -179,24 +179,24 @@ func (r Rectangle) Union(s Rectangle) Rectangle {
        return r
 }
 
-// Empty returns whether the rectangle contains no points.
+// Empty reports whether the rectangle contains no points.
 func (r Rectangle) Empty() bool {
        return r.Min.X >= r.Max.X || r.Min.Y >= r.Max.Y
 }
 
-// Eq returns whether r and s are equal.
+// Eq reports whether r and s are equal.
 func (r Rectangle) Eq(s Rectangle) bool {
        return r.Min.X == s.Min.X && r.Min.Y == s.Min.Y &&
                r.Max.X == s.Max.X && r.Max.Y == s.Max.Y
 }
 
-// Overlaps returns whether r and s have a non-empty intersection.
+// Overlaps reports whether r and s have a non-empty intersection.
 func (r Rectangle) Overlaps(s Rectangle) bool {
        return r.Min.X < s.Max.X && s.Min.X < r.Max.X &&
                r.Min.Y < s.Max.Y && s.Min.Y < r.Max.Y
 }
 
-// In returns whether every point in r is in s.
+// In reports whether every point in r is in s.
 func (r Rectangle) In(s Rectangle) bool {
        if r.Empty() {
                return true
index 03ac60606718ad23982f619a739a2079e1d936d2..32a89ef34ca8c1e9326bf136ffc9445a25bdbc40 100644 (file)
@@ -126,7 +126,7 @@ func (p *RGBA) SubImage(r Rectangle) Image {
        }
 }
 
-// Opaque scans the entire image and returns whether or not it is fully opaque.
+// Opaque scans the entire image and reports whether it is fully opaque.
 func (p *RGBA) Opaque() bool {
        if p.Rect.Empty() {
                return true
@@ -234,7 +234,7 @@ func (p *RGBA64) SubImage(r Rectangle) Image {
        }
 }
 
-// Opaque scans the entire image and returns whether or not it is fully opaque.
+// Opaque scans the entire image and reports whether it is fully opaque.
 func (p *RGBA64) Opaque() bool {
        if p.Rect.Empty() {
                return true
@@ -329,7 +329,7 @@ func (p *NRGBA) SubImage(r Rectangle) Image {
        }
 }
 
-// Opaque scans the entire image and returns whether or not it is fully opaque.
+// Opaque scans the entire image and reports whether it is fully opaque.
 func (p *NRGBA) Opaque() bool {
        if p.Rect.Empty() {
                return true
@@ -437,7 +437,7 @@ func (p *NRGBA64) SubImage(r Rectangle) Image {
        }
 }
 
-// Opaque scans the entire image and returns whether or not it is fully opaque.
+// Opaque scans the entire image and reports whether it is fully opaque.
 func (p *NRGBA64) Opaque() bool {
        if p.Rect.Empty() {
                return true
@@ -525,7 +525,7 @@ func (p *Alpha) SubImage(r Rectangle) Image {
        }
 }
 
-// Opaque scans the entire image and returns whether or not it is fully opaque.
+// Opaque scans the entire image and reports whether it is fully opaque.
 func (p *Alpha) Opaque() bool {
        if p.Rect.Empty() {
                return true
@@ -616,7 +616,7 @@ func (p *Alpha16) SubImage(r Rectangle) Image {
        }
 }
 
-// Opaque scans the entire image and returns whether or not it is fully opaque.
+// Opaque scans the entire image and reports whether it is fully opaque.
 func (p *Alpha16) Opaque() bool {
        if p.Rect.Empty() {
                return true
@@ -704,7 +704,7 @@ func (p *Gray) SubImage(r Rectangle) Image {
        }
 }
 
-// Opaque scans the entire image and returns whether or not it is fully opaque.
+// Opaque scans the entire image and reports whether it is fully opaque.
 func (p *Gray) Opaque() bool {
        return true
 }
@@ -782,7 +782,7 @@ func (p *Gray16) SubImage(r Rectangle) Image {
        }
 }
 
-// Opaque scans the entire image and returns whether or not it is fully opaque.
+// Opaque scans the entire image and reports whether it is fully opaque.
 func (p *Gray16) Opaque() bool {
        return true
 }
@@ -873,7 +873,7 @@ func (p *Paletted) SubImage(r Rectangle) Image {
        }
 }
 
-// Opaque scans the entire image and returns whether or not it is fully opaque.
+// Opaque scans the entire image and reports whether it is fully opaque.
 func (p *Paletted) Opaque() bool {
        var present [256]bool
        i0, i1 := 0, p.Rect.Dx()
index 7389f7e4fe81395e81e71a152bfd72808f6f0f6c..845e758878934fe67848796ca34e4efb0d43a999 100644 (file)
@@ -90,7 +90,7 @@ func TestDCT(t *testing.T) {
        }
 }
 
-// differ returns whether any pair-wise elements in b0 and b1 differ by 2 or
+// differ reports whether any pair-wise elements in b0 and b1 differ by 2 or
 // more. That tolerance is because there isn't a single definitive decoding of
 // a given JPEG image, even before the YCbCr to RGB conversion; implementations
 // can have different IDCT rounding errors.
index 04ee2cfb47c55ec5efe03861eb22dc47e5ecb3e0..8985f492140aaf5710c698a5d1dad7bce2ebc4f9 100644 (file)
@@ -41,7 +41,7 @@ func (c *Uniform) Bounds() Rectangle { return Rectangle{Point{-1e9, -1e9}, Point
 
 func (c *Uniform) At(x, y int) color.Color { return c.C }
 
-// Opaque scans the entire image and returns whether or not it is fully opaque.
+// Opaque scans the entire image and reports whether it is fully opaque.
 func (c *Uniform) Opaque() bool {
        _, _, _, a := c.C.RGBA()
        return a == 0xffff
index 0df0b1cc9f124b4078491d02fc547bc7f2aed951..d85ee9cb137775ad39aaafc9c2e72b851449abdd 100644 (file)
@@ -27,7 +27,7 @@ func Inf(sign int) float64 {
 // NaN returns an IEEE 754 ``not-a-number'' value.
 func NaN() float64 { return Float64frombits(uvnan) }
 
-// IsNaN returns whether f is an IEEE 754 ``not-a-number'' value.
+// IsNaN reports whether f is an IEEE 754 ``not-a-number'' value.
 func IsNaN(f float64) (is bool) {
        // IEEE 754 says that only NaNs satisfy f != f.
        // To avoid the floating-point hardware, could use:
@@ -36,10 +36,10 @@ func IsNaN(f float64) (is bool) {
        return f != f
 }
 
-// IsInf returns whether f is an infinity, according to sign.
-// If sign > 0, IsInf returns whether f is positive infinity.
-// If sign < 0, IsInf returns whether f is negative infinity.
-// If sign == 0, IsInf returns whether f is either infinity.
+// IsInf reports whether f is an infinity, according to sign.
+// If sign > 0, IsInf reports whether f is positive infinity.
+// If sign < 0, IsInf reports whether f is negative infinity.
+// If sign == 0, IsInf reports whether f is either infinity.
 func IsInf(f float64, sign int) bool {
        // Test for infinity by comparing against maximum float.
        // To avoid the floating-point hardware, could use:
index 2c862a647910e90f9ef3e3c847fc454a62d19595..2b4f5b433ec51c3b6643349e1268dd7db0f8d0f3 100644 (file)
@@ -272,7 +272,7 @@ func (r *Reader) NextPart() (*Part, error) {
        }
 }
 
-// isFinalBoundary returns whether line is the final boundary line
+// isFinalBoundary reports whether line is the final boundary line
 // indicating that all parts are over.
 // It matches `^--boundary--[ \t]*(\r\n)?$`
 func (mr *Reader) isFinalBoundary(line []byte) bool {
@@ -307,8 +307,8 @@ func (mr *Reader) isBoundaryDelimiterLine(line []byte) (ret bool) {
        return bytes.Equal(rest, mr.nl)
 }
 
-// peekBufferIsEmptyPart returns whether the provided peek-ahead
-// buffer represents an empty part.  This is only called if we've not
+// peekBufferIsEmptyPart reports whether the provided peek-ahead
+// buffer represents an empty part. It is called only if we've not
 // already read any bytes in this part and checks for the case of MIME
 // software not writing the \r\n on empty parts. Some does, some
 // doesn't.
index 5977d48b6314f1075b0596c6741039980a98ce89..389ab58e4182f5d84c5d0fae15d974748e9cf4ee 100644 (file)
@@ -142,7 +142,7 @@ func (e *entry) pathMatch(requestPath string) bool {
        return false
 }
 
-// hasDotSuffix returns whether s ends in "."+suffix.
+// hasDotSuffix reports whether s ends in "."+suffix.
 func hasDotSuffix(s, suffix string) bool {
        return len(s) > len(suffix) && s[len(s)-len(suffix)-1] == '.' && s[len(s)-len(suffix):] == suffix
 }
@@ -316,7 +316,7 @@ func canonicalHost(host string) (string, error) {
        return toASCII(host)
 }
 
-// hasPort returns whether host contains a port number. host may be a host
+// hasPort reports whether host contains a port number. host may be a host
 // name, an IPv4 or an IPv6 address.
 func hasPort(host string) bool {
        colons := strings.Count(host, ":")
@@ -357,7 +357,7 @@ func jarKey(host string, psl PublicSuffixList) string {
        return host[prevDot+1:]
 }
 
-// isIP returns whether host is an IP address.
+// isIP reports whether host is an IP address.
 func isIP(host string) bool {
        return net.ParseIP(host) != nil
 }
@@ -380,7 +380,7 @@ func defaultPath(path string) string {
 // is compared to c.Expires to determine deletion of c. defPath and host are the
 // default-path and the canonical host name of the URL c was received from.
 //
-// remove is whether the jar should delete this cookie, as it has already
+// remove records whether the jar should delete this cookie, as it has already
 // expired with respect to now. In this case, e may be incomplete, but it will
 // be valid to call e.id (which depends on e's Name, Domain and Path).
 //
index 6374237fba199b80b52e17acea1a2739eced2a2b..ca1ae07c25df6f003c1a59f19466407ea7558b9d 100644 (file)
@@ -173,7 +173,7 @@ func (h Header) WriteSubset(w io.Writer, exclude map[string]bool) error {
 // canonical key for "accept-encoding" is "Accept-Encoding".
 func CanonicalHeaderKey(s string) string { return textproto.CanonicalMIMEHeaderKey(s) }
 
-// hasToken returns whether token appears with v, ASCII
+// hasToken reports whether token appears with v, ASCII
 // case-insensitive, with space or comma boundaries.
 // token must be all lowercase.
 // v may contain mixed cased.
index 3b29aefcd0340bb33c8e6aa9ee6c2a6fef06dc5f..14cc42f53c1085aa7c1785b2106992d6efce0f35 100644 (file)
@@ -183,7 +183,7 @@ type Request struct {
        TLS *tls.ConnectionState
 }
 
-// ProtoAtLeast returns whether the HTTP protocol used
+// ProtoAtLeast reports whether the HTTP protocol used
 // in the request is at least major.minor.
 func (r *Request) ProtoAtLeast(major, minor int) bool {
        return r.ProtoMajor > major ||
index 9a7e4e319b09a0db296293b73b2931231fb34cce..0d7c8248a7edf973790822d8030675bb2d876665 100644 (file)
@@ -168,7 +168,7 @@ func fixPragmaCacheControl(header Header) {
        }
 }
 
-// ProtoAtLeast returns whether the HTTP protocol used
+// ProtoAtLeast reports whether the HTTP protocol used
 // in the response is at least major.minor.
 func (r *Response) ProtoAtLeast(major, minor int) bool {
        return r.ProtoMajor > major ||
index e0002850476502082903712443add8f43d28da0b..e0f629347e0aa47cf8e4911f56aa47abab044887 100644 (file)
@@ -336,7 +336,7 @@ func (w *response) requestTooLarge() {
        }
 }
 
-// needsSniff returns whether a Content-Type still needs to be sniffed.
+// needsSniff reports whether a Content-Type still needs to be sniffed.
 func (w *response) needsSniff() bool {
        return !w.cw.wroteHeader && w.handlerHeader.Get("Content-Type") == "" && w.written < sniffLen
 }
@@ -1044,7 +1044,7 @@ func (c *conn) closeWriteAndWait() {
        time.Sleep(rstAvoidanceDelay)
 }
 
-// validNPN returns whether the proto is not a blacklisted Next
+// validNPN reports whether the proto is not a blacklisted Next
 // Protocol Negotiation protocol.  Empty and built-in protocol types
 // are blacklisted and can't be overridden with alternate
 // implementations.
index 2b227735a891af79a5d670019249a3228a2b5c2b..ce56a563e5eab6da024e8a5ba55f09a9b95c58bf 100644 (file)
@@ -238,7 +238,7 @@ type transferReader struct {
        Trailer          Header
 }
 
-// bodyAllowedForStatus returns whether a given response status code
+// bodyAllowedForStatus reports whether a given response status code
 // permits a body.  See RFC2616, section 4.4.
 func bodyAllowedForStatus(status int) bool {
        switch {
index 2cc17530c2f518d20015604ef1267d4a6956948f..c8d0a8632a7b40d0133739e4cab5adb07d50fee1 100644 (file)
@@ -58,7 +58,7 @@ func (p *ProcessState) SystemTime() time.Duration {
        return p.systemTime()
 }
 
-// Exited returns whether the program has exited.
+// Exited reports whether the program has exited.
 func (p *ProcessState) Exited() bool {
        return p.exited()
 }
index a7977ff19145bf7da3e468fecc4013c152dde836..8810e693067b239a4254872fd6d60ac17f432471 100644 (file)
@@ -43,20 +43,23 @@ func NewSyscallError(syscall string, err error) error {
        return &SyscallError{syscall, err}
 }
 
-// IsExist returns whether the error is known to report that a file or directory
-// already exists. It is satisfied by ErrExist as well as some syscall errors.
+// IsExist returns a boolean indicating whether the error is known to report
+// that a file or directory already exists. It is satisfied by ErrExist as
+// well as some syscall errors.
 func IsExist(err error) bool {
        return isExist(err)
 }
 
-// IsNotExist returns whether the error is known to report that a file or directory
-// does not exist. It is satisfied by ErrNotExist as well as some syscall errors.
+// IsNotExist returns a boolean indicating whether the error is known to
+// report that a file or directory does not exist. It is satisfied by
+// ErrNotExist as well as some syscall errors.
 func IsNotExist(err error) bool {
        return isNotExist(err)
 }
 
-// IsPermission returns whether the error is known to report that permission is denied.
-// It is satisfied by ErrPermission as well as some syscall errors.
+// IsPermission returns a boolean indicating whether the error is known to
+// report that permission is denied. It is satisfied by ErrPermission as well
+// as some syscall errors.
 func IsPermission(err error) bool {
        return isPermission(err)
 }
index c392b376f1bc00b69bedbea46a8dfa00136b5832..0046026eaebdcfe1c8ed14525c3c451ad07aa7aa 100644 (file)
@@ -375,21 +375,18 @@ func (re *Regexp) LiteralPrefix() (prefix string, complete bool) {
        return re.prefix, re.prefixComplete
 }
 
-// MatchReader returns whether the Regexp matches the text read by the
-// RuneReader.  The return value is a boolean: true for match, false for no
-// match.
+// MatchReader reports whether the Regexp matches the text read by the
+// RuneReader.
 func (re *Regexp) MatchReader(r io.RuneReader) bool {
        return re.doExecute(r, nil, "", 0, 0) != nil
 }
 
-// MatchString returns whether the Regexp matches the string s.
-// The return value is a boolean: true for match, false for no match.
+// MatchString reports whether the Regexp matches the string s.
 func (re *Regexp) MatchString(s string) bool {
        return re.doExecute(nil, nil, s, 0, 0) != nil
 }
 
-// Match returns whether the Regexp matches the byte slice b.
-// The return value is a boolean: true for match, false for no match.
+// Match reports whether the Regexp matches the byte slice b.
 func (re *Regexp) Match(b []byte) bool {
        return re.doExecute(nil, b, "", 0, 0) != nil
 }
index edef06ff363c9b53bd4cc45850dbb055f48edc0f..f06eb3827ab6e8ff67fd38b7dd0175d00ff91f59 100644 (file)
@@ -12,8 +12,8 @@ package sort
 type Interface interface {
        // Len is the number of elements in the collection.
        Len() int
-       // Less returns whether the element with index i should sort
-       // before the element with index j.
+       // Less reports whether the element with
+       // index i should sort before the element with index j.
        Less(i, j int) bool
        // Swap swaps the elements with indexes i and j.
        Swap(i, j int)
index 8ec8174a162fa48aded879d691543100f96d66f1..b227a3534f07fcf30cd78d3a97e82f434e9b24ad 100644 (file)
@@ -201,7 +201,7 @@ func (s *state) walkIfOrWith(typ parse.NodeType, dot reflect.Value, pipe *parse.
        }
 }
 
-// isTrue returns whether the value is 'true', in the sense of not the zero of its type,
+// isTrue reports whether the value is 'true', in the sense of not the zero of its type,
 // and whether the value has a meaningful truth value.
 func isTrue(val reflect.Value) (truth, ok bool) {
        if !val.IsValid() {