Commit 2adc4e89 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

all: use "reports whether" in place of "returns true if(f)"

Comment changes only.

Change-Id: I56848814564c4aa0988b451df18bebdfc88d6d94
Reviewed-on: https://go-review.googlesource.com/7721Reviewed-by: default avatarRob Pike <r@golang.org>
parent fcb895fe
...@@ -233,7 +233,7 @@ func (h *FileHeader) SetMode(mode os.FileMode) { ...@@ -233,7 +233,7 @@ func (h *FileHeader) SetMode(mode os.FileMode) {
} }
} }
// isZip64 returns true if the file size exceeds the 32 bit limit // isZip64 reports whether the file size exceeds the 32 bit limit
func (fh *FileHeader) isZip64() bool { func (fh *FileHeader) isZip64() bool {
return fh.CompressedSize64 > uint32max || fh.UncompressedSize64 > uint32max return fh.CompressedSize64 > uint32max || fh.UncompressedSize64 > uint32max
} }
......
...@@ -1042,7 +1042,7 @@ func (tr *TypeRepr) String() string { ...@@ -1042,7 +1042,7 @@ func (tr *TypeRepr) String() string {
return fmt.Sprintf(tr.Repr, tr.FormatArgs...) return fmt.Sprintf(tr.Repr, tr.FormatArgs...)
} }
// Empty returns true if the result of String would be "". // Empty reports whether the result of String would be "".
func (tr *TypeRepr) Empty() bool { func (tr *TypeRepr) Empty() bool {
return len(tr.Repr) == 0 return len(tr.Repr) == 0
} }
......
...@@ -87,7 +87,7 @@ type Name struct { ...@@ -87,7 +87,7 @@ type Name struct {
Const string // constant definition Const string // constant definition
} }
// IsVar returns true if Kind is either "var" or "fpvar" // IsVar reports whether Kind is either "var" or "fpvar"
func (n *Name) IsVar() bool { func (n *Name) IsVar() bool {
return n.Kind == "var" || n.Kind == "fpvar" return n.Kind == "var" || n.Kind == "fpvar"
} }
......
...@@ -55,7 +55,7 @@ func error_(pos token.Pos, msg string, args ...interface{}) { ...@@ -55,7 +55,7 @@ func error_(pos token.Pos, msg string, args ...interface{}) {
fmt.Fprintf(os.Stderr, "\n") fmt.Fprintf(os.Stderr, "\n")
} }
// isName returns true if s is a valid C identifier // isName reports whether s is a valid C identifier
func isName(s string) bool { func isName(s string) bool {
for i, v := range s { for i, v := range s {
if v != '_' && (v < 'A' || v > 'Z') && (v < 'a' || v > 'z') && (v < '0' || v > '9') { if v != '_' && (v < 'A' || v > 'Z') && (v < 'a' || v > 'z') && (v < '0' || v > '9') {
......
...@@ -282,7 +282,7 @@ func walkBeforeAfter(x interface{}, before, after func(interface{})) { ...@@ -282,7 +282,7 @@ func walkBeforeAfter(x interface{}, before, after func(interface{})) {
after(x) after(x)
} }
// imports returns true if f imports path. // imports reports whether f imports path.
func imports(f *ast.File, path string) bool { func imports(f *ast.File, path string) bool {
return importSpec(f, path) != nil return importSpec(f, path) != nil
} }
...@@ -322,33 +322,33 @@ func declImports(gen *ast.GenDecl, path string) bool { ...@@ -322,33 +322,33 @@ func declImports(gen *ast.GenDecl, path string) bool {
return false return false
} }
// isPkgDot returns true if t is the expression "pkg.name" // isPkgDot reports whether t is the expression "pkg.name"
// where pkg is an imported identifier. // where pkg is an imported identifier.
func isPkgDot(t ast.Expr, pkg, name string) bool { func isPkgDot(t ast.Expr, pkg, name string) bool {
sel, ok := t.(*ast.SelectorExpr) sel, ok := t.(*ast.SelectorExpr)
return ok && isTopName(sel.X, pkg) && sel.Sel.String() == name return ok && isTopName(sel.X, pkg) && sel.Sel.String() == name
} }
// isPtrPkgDot returns true if f is the expression "*pkg.name" // isPtrPkgDot reports whether f is the expression "*pkg.name"
// where pkg is an imported identifier. // where pkg is an imported identifier.
func isPtrPkgDot(t ast.Expr, pkg, name string) bool { func isPtrPkgDot(t ast.Expr, pkg, name string) bool {
ptr, ok := t.(*ast.StarExpr) ptr, ok := t.(*ast.StarExpr)
return ok && isPkgDot(ptr.X, pkg, name) return ok && isPkgDot(ptr.X, pkg, name)
} }
// isTopName returns true if n is a top-level unresolved identifier with the given name. // isTopName reports whether n is a top-level unresolved identifier with the given name.
func isTopName(n ast.Expr, name string) bool { func isTopName(n ast.Expr, name string) bool {
id, ok := n.(*ast.Ident) id, ok := n.(*ast.Ident)
return ok && id.Name == name && id.Obj == nil return ok && id.Name == name && id.Obj == nil
} }
// isName returns true if n is an identifier with the given name. // isName reports whether n is an identifier with the given name.
func isName(n ast.Expr, name string) bool { func isName(n ast.Expr, name string) bool {
id, ok := n.(*ast.Ident) id, ok := n.(*ast.Ident)
return ok && id.String() == name return ok && id.String() == name
} }
// isCall returns true if t is a call to pkg.name. // isCall reports whether t is a call to pkg.name.
func isCall(t ast.Expr, pkg, name string) bool { func isCall(t ast.Expr, pkg, name string) bool {
call, ok := t.(*ast.CallExpr) call, ok := t.(*ast.CallExpr)
return ok && isPkgDot(call.Fun, pkg, name) return ok && isPkgDot(call.Fun, pkg, name)
...@@ -360,7 +360,7 @@ func isIdent(n interface{}) *ast.Ident { ...@@ -360,7 +360,7 @@ func isIdent(n interface{}) *ast.Ident {
return id return id
} }
// refersTo returns true if n is a reference to the same object as x. // refersTo reports whether n is a reference to the same object as x.
func refersTo(n ast.Node, x *ast.Ident) bool { func refersTo(n ast.Node, x *ast.Ident) bool {
id, ok := n.(*ast.Ident) id, ok := n.(*ast.Ident)
// The test of id.Name == x.Name handles top-level unresolved // The test of id.Name == x.Name handles top-level unresolved
...@@ -368,12 +368,12 @@ func refersTo(n ast.Node, x *ast.Ident) bool { ...@@ -368,12 +368,12 @@ func refersTo(n ast.Node, x *ast.Ident) bool {
return ok && id.Obj == x.Obj && id.Name == x.Name return ok && id.Obj == x.Obj && id.Name == x.Name
} }
// isBlank returns true if n is the blank identifier. // isBlank reports whether n is the blank identifier.
func isBlank(n ast.Expr) bool { func isBlank(n ast.Expr) bool {
return isName(n, "_") return isName(n, "_")
} }
// isEmptyString returns true if n is an empty string literal. // isEmptyString reports whether n is an empty string literal.
func isEmptyString(n ast.Expr) bool { func isEmptyString(n ast.Expr) bool {
lit, ok := n.(*ast.BasicLit) lit, ok := n.(*ast.BasicLit)
return ok && lit.Kind == token.STRING && len(lit.Value) == 2 return ok && lit.Kind == token.STRING && len(lit.Value) == 2
...@@ -430,7 +430,7 @@ func rewriteUses(x *ast.Ident, f, fnot func(token.Pos) ast.Expr, scope []ast.Stm ...@@ -430,7 +430,7 @@ func rewriteUses(x *ast.Ident, f, fnot func(token.Pos) ast.Expr, scope []ast.Stm
} }
} }
// assignsTo returns true if any of the code in scope assigns to or takes the address of x. // assignsTo reports whether any of the code in scope assigns to or takes the address of x.
func assignsTo(x *ast.Ident, scope []ast.Stmt) bool { func assignsTo(x *ast.Ident, scope []ast.Stmt) bool {
assigned := false assigned := false
ff := func(n interface{}) { ff := func(n interface{}) {
......
...@@ -176,7 +176,7 @@ func (s *importStack) copy() []string { ...@@ -176,7 +176,7 @@ func (s *importStack) copy() []string {
return append([]string{}, *s...) return append([]string{}, *s...)
} }
// shorterThan returns true if sp is shorter than t. // shorterThan reports whether sp is shorter than t.
// We use this to record the shortest import sequence // We use this to record the shortest import sequence
// that leads to a particular package. // that leads to a particular package.
func (sp *importStack) shorterThan(t []string) bool { func (sp *importStack) shorterThan(t []string) bool {
......
...@@ -154,7 +154,7 @@ func isWildcard(s string) bool { ...@@ -154,7 +154,7 @@ func isWildcard(s string) bool {
return size == len(s) && unicode.IsLower(rune) return size == len(s) && unicode.IsLower(rune)
} }
// match returns true if pattern matches val, // match reports whether pattern matches val,
// recording wildcard submatches in m. // recording wildcard submatches in m.
// If m == nil, match checks whether pattern == val. // If m == nil, match checks whether pattern == val.
func match(m map[string]reflect.Value, pattern, val reflect.Value) bool { func match(m map[string]reflect.Value, pattern, val reflect.Value) bool {
......
...@@ -24,7 +24,7 @@ import ( ...@@ -24,7 +24,7 @@ import (
type Curve interface { type Curve interface {
// Params returns the parameters for the curve. // Params returns the parameters for the curve.
Params() *CurveParams Params() *CurveParams
// IsOnCurve returns true if the given (x,y) lies on the curve. // IsOnCurve reports whether the given (x,y) lies on the curve.
IsOnCurve(x, y *big.Int) bool IsOnCurve(x, y *big.Int) bool
// Add returns the sum of (x1,y1) and (x2,y2) // Add returns the sum of (x1,y1) and (x2,y2)
Add(x1, y1, x2, y2 *big.Int) (x, y *big.Int) Add(x1, y1, x2, y2 *big.Int) (x, y *big.Int)
......
...@@ -11,7 +11,7 @@ The receiver verifies the hash by recomputing it using the same key. ...@@ -11,7 +11,7 @@ The receiver verifies the hash by recomputing it using the same key.
Receivers should be careful to use Equal to compare MACs in order to avoid Receivers should be careful to use Equal to compare MACs in order to avoid
timing side-channels: timing side-channels:
// CheckMAC returns true if messageMAC is a valid HMAC tag for message. // CheckMAC reports whether messageMAC is a valid HMAC tag for message.
func CheckMAC(message, messageMAC, key []byte) bool { func CheckMAC(message, messageMAC, key []byte) bool {
mac := hmac.New(sha256.New, key) mac := hmac.New(sha256.New, key)
mac.Write(message) mac.Write(message)
......
...@@ -238,7 +238,7 @@ Curves: ...@@ -238,7 +238,7 @@ Curves:
return false, nil return false, nil
} }
// checkForResumption returns true if we should perform resumption on this connection. // checkForResumption reports whether we should perform resumption on this connection.
func (hs *serverHandshakeState) checkForResumption() bool { func (hs *serverHandshakeState) checkForResumption() bool {
c := hs.c c := hs.c
......
...@@ -77,7 +77,7 @@ func (s *CertPool) AddCert(cert *Certificate) { ...@@ -77,7 +77,7 @@ func (s *CertPool) AddCert(cert *Certificate) {
} }
// AppendCertsFromPEM attempts to parse a series of PEM encoded certificates. // AppendCertsFromPEM attempts to parse a series of PEM encoded certificates.
// It appends any certificates found to s and returns true if any certificates // It appends any certificates found to s and reports whether any certificates
// were successfully parsed. // were successfully parsed.
// //
// On many Linux systems, /etc/ssl/cert.pem will contain the system wide set // On many Linux systems, /etc/ssl/cert.pem will contain the system wide set
......
...@@ -320,7 +320,7 @@ func parsePrintableString(bytes []byte) (ret string, err error) { ...@@ -320,7 +320,7 @@ func parsePrintableString(bytes []byte) (ret string, err error) {
return return
} }
// isPrintable returns true iff the given b is in the ASN.1 PrintableString set. // isPrintable reports whether the given b is in the ASN.1 PrintableString set.
func isPrintable(b byte) bool { func isPrintable(b byte) bool {
return 'a' <= b && b <= 'z' || return 'a' <= b && b <= 'z' ||
'A' <= b && b <= 'Z' || 'A' <= b && b <= 'Z' ||
......
...@@ -114,7 +114,7 @@ func (w *Writer) WriteAll(records [][]string) (err error) { ...@@ -114,7 +114,7 @@ func (w *Writer) WriteAll(records [][]string) (err error) {
return w.w.Flush() return w.w.Flush()
} }
// fieldNeedsQuotes returns true if our field must be enclosed in quotes. // fieldNeedsQuotes reports whether our field must be enclosed in quotes.
// Fields with a Comma, fields with a quote or newline, and // Fields with a Comma, fields with a quote or newline, and
// fields which start with a space must be enclosed in quotes. // fields which start with a space must be enclosed in quotes.
// We used to quote empty strings, but we do not anymore (as of Go 1.4). // We used to quote empty strings, but we do not anymore (as of Go 1.4).
......
...@@ -923,7 +923,7 @@ func Parse() { ...@@ -923,7 +923,7 @@ func Parse() {
CommandLine.Parse(os.Args[1:]) CommandLine.Parse(os.Args[1:])
} }
// Parsed returns true if the command-line flags have been parsed. // Parsed reports whether the command-line flags have been parsed.
func Parsed() bool { func Parsed() bool {
return CommandLine.Parsed() return CommandLine.Parsed()
} }
......
...@@ -23,8 +23,7 @@ func exportFilter(name string) bool { ...@@ -23,8 +23,7 @@ func exportFilter(name string) bool {
// body) are removed. Non-exported fields and methods of exported types are // body) are removed. Non-exported fields and methods of exported types are
// stripped. The File.Comments list is not changed. // stripped. The File.Comments list is not changed.
// //
// FileExports returns true if there are exported declarations; // FileExports reports whether there are exported declarations.
// it returns false otherwise.
// //
func FileExports(src *File) bool { func FileExports(src *File) bool {
return filterFile(src, exportFilter, true) return filterFile(src, exportFilter, true)
...@@ -34,7 +33,7 @@ func FileExports(src *File) bool { ...@@ -34,7 +33,7 @@ func FileExports(src *File) bool {
// only exported nodes remain. The pkg.Files list is not changed, so that // only exported nodes remain. The pkg.Files list is not changed, so that
// file names and top-level package comments don't get lost. // file names and top-level package comments don't get lost.
// //
// PackageExports returns true if there are exported declarations; // PackageExports reports whether there are exported declarations;
// it returns false otherwise. // it returns false otherwise.
// //
func PackageExports(pkg *Package) bool { func PackageExports(pkg *Package) bool {
...@@ -199,8 +198,8 @@ func filterSpecList(list []Spec, f Filter, export bool) []Spec { ...@@ -199,8 +198,8 @@ func filterSpecList(list []Spec, f Filter, export bool) []Spec {
// all names (including struct field and interface method names, but // all names (including struct field and interface method names, but
// not from parameter lists) that don't pass through the filter f. // not from parameter lists) that don't pass through the filter f.
// //
// FilterDecl returns true if there are any declared names left after // FilterDecl reports whether there are any declared names left after
// filtering; it returns false otherwise. // filtering.
// //
func FilterDecl(decl Decl, f Filter) bool { func FilterDecl(decl Decl, f Filter) bool {
return filterDecl(decl, f, false) return filterDecl(decl, f, false)
...@@ -224,8 +223,8 @@ func filterDecl(decl Decl, f Filter, export bool) bool { ...@@ -224,8 +223,8 @@ func filterDecl(decl Decl, f Filter, export bool) bool {
// the declaration is removed from the AST. Import declarations are // the declaration is removed from the AST. Import declarations are
// always removed. The File.Comments list is not changed. // always removed. The File.Comments list is not changed.
// //
// FilterFile returns true if there are any top-level declarations // FilterFile reports whether there are any top-level declarations
// left after filtering; it returns false otherwise. // left after filtering.
// //
func FilterFile(src *File, f Filter) bool { func FilterFile(src *File, f Filter) bool {
return filterFile(src, f, false) return filterFile(src, f, false)
...@@ -251,8 +250,8 @@ func filterFile(src *File, f Filter, export bool) bool { ...@@ -251,8 +250,8 @@ func filterFile(src *File, f Filter, export bool) bool {
// changed, so that file names and top-level package comments don't get // changed, so that file names and top-level package comments don't get
// lost. // lost.
// //
// FilterPackage returns true if there are any top-level declarations // FilterPackage reports whether there are any top-level declarations
// left after filtering; it returns false otherwise. // left after filtering.
// //
func FilterPackage(pkg *Package, f Filter) bool { func FilterPackage(pkg *Package, f Filter) bool {
return filterPackage(pkg, f, false) return filterPackage(pkg, f, false)
......
...@@ -1228,7 +1228,7 @@ func splitQuoted(s string) (r []string, err error) { ...@@ -1228,7 +1228,7 @@ func splitQuoted(s string) (r []string, err error) {
return args, err return args, err
} }
// match returns true if the name is one of: // match reports whether the name is one of:
// //
// $GOOS // $GOOS
// $GOARCH // $GOARCH
......
...@@ -63,7 +63,7 @@ func removeErrorField(ityp *ast.InterfaceType) { ...@@ -63,7 +63,7 @@ func removeErrorField(ityp *ast.InterfaceType) {
} }
// filterFieldList removes unexported fields (field names) from the field list // filterFieldList removes unexported fields (field names) from the field list
// in place and returns true if fields were removed. Anonymous fields are // in place and reports whether fields were removed. Anonymous fields are
// recorded with the parent type. filterType is called with the types of // recorded with the parent type. filterType is called with the types of
// all remaining fields. // all remaining fields.
// //
......
...@@ -1365,7 +1365,7 @@ func (p *parser) checkExpr(x ast.Expr) ast.Expr { ...@@ -1365,7 +1365,7 @@ func (p *parser) checkExpr(x ast.Expr) ast.Expr {
return x return x
} }
// isTypeName returns true iff x is a (qualified) TypeName. // isTypeName reports whether x is a (qualified) TypeName.
func isTypeName(x ast.Expr) bool { func isTypeName(x ast.Expr) bool {
switch t := x.(type) { switch t := x.(type) {
case *ast.BadExpr: case *ast.BadExpr:
...@@ -1379,7 +1379,7 @@ func isTypeName(x ast.Expr) bool { ...@@ -1379,7 +1379,7 @@ func isTypeName(x ast.Expr) bool {
return true return true
} }
// isLiteralType returns true iff x is a legal composite literal type. // isLiteralType reports whether x is a legal composite literal type.
func isLiteralType(x ast.Expr) bool { func isLiteralType(x ast.Expr) bool {
switch t := x.(type) { switch t := x.(type) {
case *ast.BadExpr: case *ast.BadExpr:
......
...@@ -144,7 +144,7 @@ func (p *printer) nextComment() { ...@@ -144,7 +144,7 @@ func (p *printer) nextComment() {
p.commentOffset = infinity p.commentOffset = infinity
} }
// commentBefore returns true iff the current comment group occurs // commentBefore reports whether the current comment group occurs
// before the next position in the source code and printing it does // before the next position in the source code and printing it does
// not introduce implicit semicolons. // not introduce implicit semicolons.
// //
......
...@@ -1165,7 +1165,7 @@ func (p *parser) checkExpr(x ast.Expr) ast.Expr { ...@@ -1165,7 +1165,7 @@ func (p *parser) checkExpr(x ast.Expr) ast.Expr {
return x return x
} }
// isTypeName returns true iff x is a (qualified) TypeName. // isTypeName reports whether x is a (qualified) TypeName.
func isTypeName(x ast.Expr) bool { func isTypeName(x ast.Expr) bool {
switch t := x.(type) { switch t := x.(type) {
case *ast.BadExpr: case *ast.BadExpr:
...@@ -1179,7 +1179,7 @@ func isTypeName(x ast.Expr) bool { ...@@ -1179,7 +1179,7 @@ func isTypeName(x ast.Expr) bool {
return true return true
} }
// isLiteralType returns true iff x is a legal composite literal type. // isLiteralType reports whether x is a legal composite literal type.
func isLiteralType(x ast.Expr) bool { func isLiteralType(x ast.Expr) bool {
switch t := x.(type) { switch t := x.(type) {
case *ast.BadExpr: case *ast.BadExpr:
......
...@@ -24,7 +24,7 @@ type Position struct { ...@@ -24,7 +24,7 @@ type Position struct {
Column int // column number, starting at 1 (byte count) Column int // column number, starting at 1 (byte count)
} }
// IsValid returns true if the position is valid. // IsValid reports whether the position is valid.
func (pos *Position) IsValid() bool { return pos.Line > 0 } func (pos *Position) IsValid() bool { return pos.Line > 0 }
// String returns a string in one of several forms: // String returns a string in one of several forms:
...@@ -77,7 +77,7 @@ type Pos int ...@@ -77,7 +77,7 @@ type Pos int
// //
const NoPos Pos = 0 const NoPos Pos = 0
// IsValid returns true if the position is valid. // IsValid reports whether the position is valid.
func (p Pos) IsValid() bool { func (p Pos) IsValid() bool {
return p != NoPos return p != NoPos
} }
...@@ -157,7 +157,7 @@ func (f *File) MergeLine(line int) { ...@@ -157,7 +157,7 @@ func (f *File) MergeLine(line int) {
f.lines = f.lines[:len(f.lines)-1] f.lines = f.lines[:len(f.lines)-1]
} }
// SetLines sets the line offsets for a file and returns true if successful. // SetLines sets the line offsets for a file and reports whether it succeeded.
// The line offsets are the offsets of the first character of each line; // The line offsets are the offsets of the first character of each line;
// for instance for the content "ab\nc\n" the line offsets are {0, 3}. // for instance for the content "ab\nc\n" the line offsets are {0, 3}.
// An empty file has an empty line offset table. // An empty file has an empty line offset table.
......
...@@ -335,7 +335,7 @@ func karatsuba(z, x, y nat) { ...@@ -335,7 +335,7 @@ func karatsuba(z, x, y nat) {
} }
} }
// alias returns true if x and y share the same base array. // alias reports whether x and y share the same base array.
func alias(x, y nat) bool { func alias(x, y nat) bool {
return cap(x) > 0 && cap(y) > 0 && &x[0:cap(x)][cap(x)-1] == &y[0:cap(y)][cap(y)-1] return cap(x) > 0 && cap(y) > 0 && &x[0:cap(x)][cap(x)-1] == &y[0:cap(y)][cap(y)-1]
} }
...@@ -819,7 +819,7 @@ func (z nat) xor(x, y nat) nat { ...@@ -819,7 +819,7 @@ func (z nat) xor(x, y nat) nat {
return z.norm() return z.norm()
} }
// greaterThan returns true iff (x1<<_W + x2) > (y1<<_W + y2) // greaterThan reports whether (x1<<_W + x2) > (y1<<_W + y2)
func greaterThan(x1, x2, y1, y2 Word) bool { func greaterThan(x1, x2, y1, y2 Word) bool {
return x1 > y1 || x1 == y1 && x2 > y2 return x1 > y1 || x1 == y1 && x2 > y2
} }
......
...@@ -385,7 +385,7 @@ func (x *Rat) Sign() int { ...@@ -385,7 +385,7 @@ func (x *Rat) Sign() int {
return x.a.Sign() return x.a.Sign()
} }
// IsInt returns true if the denominator of x is 1. // IsInt reports whether the denominator of x is 1.
func (x *Rat) IsInt() bool { func (x *Rat) IsInt() bool {
return len(x.b.abs) == 0 || x.b.abs.cmp(natOne) == 0 return len(x.b.abs) == 0 || x.b.abs.cmp(natOne) == 0
} }
......
...@@ -8,13 +8,13 @@ import ( ...@@ -8,13 +8,13 @@ import (
"strings" "strings"
) )
// isTSpecial returns true if rune is in 'tspecials' as defined by RFC // isTSpecial reports whether rune is in 'tspecials' as defined by RFC
// 1521 and RFC 2045. // 1521 and RFC 2045.
func isTSpecial(r rune) bool { func isTSpecial(r rune) bool {
return strings.IndexRune(`()<>@,;:\"/[]?=`, r) != -1 return strings.IndexRune(`()<>@,;:\"/[]?=`, r) != -1
} }
// isTokenChar returns true if rune is in 'token' as defined by RFC // isTokenChar reports whether rune is in 'token' as defined by RFC
// 1521 and RFC 2045. // 1521 and RFC 2045.
func isTokenChar(r rune) bool { func isTokenChar(r rune) bool {
// token := 1*<any (US-ASCII) CHAR except SPACE, CTLs, // token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,
...@@ -22,7 +22,7 @@ func isTokenChar(r rune) bool { ...@@ -22,7 +22,7 @@ func isTokenChar(r rune) bool {
return r > 0x20 && r < 0x7f && !isTSpecial(r) return r > 0x20 && r < 0x7f && !isTSpecial(r)
} }
// isToken returns true if s is a 'token' as defined by RFC 1521 // isToken reports whether s is a 'token' as defined by RFC 1521
// and RFC 2045. // and RFC 2045.
func isToken(s string) bool { func isToken(s string) bool {
if s == "" { if s == "" {
......
...@@ -981,7 +981,7 @@ func statusLine(req *Request, code int) string { ...@@ -981,7 +981,7 @@ func statusLine(req *Request, code int) string {
return line return line
} }
// bodyAllowed returns true if a Write is allowed for this response type. // bodyAllowed reports whether a Write is allowed for this response type.
// It's illegal to call this before the header has been flushed. // It's illegal to call this before the header has been flushed.
func (w *response) bodyAllowed() bool { func (w *response) bodyAllowed() bool {
if !w.wroteHeader { if !w.wroteHeader {
......
...@@ -662,7 +662,7 @@ func (t *Transport) dialConn(cm connectMethod) (*persistConn, error) { ...@@ -662,7 +662,7 @@ func (t *Transport) dialConn(cm connectMethod) (*persistConn, error) {
return pconn, nil return pconn, nil
} }
// useProxy returns true if requests to addr should use a proxy, // useProxy reports whether requests to addr should use a proxy,
// according to the NO_PROXY or no_proxy environment variable. // according to the NO_PROXY or no_proxy environment variable.
// addr is always a canonicalAddr with a host and port. // addr is always a canonicalAddr with a host and port.
func useProxy(addr string) bool { func useProxy(addr string) bool {
......
...@@ -108,7 +108,7 @@ var ( ...@@ -108,7 +108,7 @@ var (
IPv6linklocalallrouters = IP{0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x02} IPv6linklocalallrouters = IP{0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x02}
) )
// IsUnspecified returns true if ip is an unspecified address. // IsUnspecified reports whether ip is an unspecified address.
func (ip IP) IsUnspecified() bool { func (ip IP) IsUnspecified() bool {
if ip.Equal(IPv4zero) || ip.Equal(IPv6unspecified) { if ip.Equal(IPv4zero) || ip.Equal(IPv6unspecified) {
return true return true
...@@ -116,7 +116,7 @@ func (ip IP) IsUnspecified() bool { ...@@ -116,7 +116,7 @@ func (ip IP) IsUnspecified() bool {
return false return false
} }
// IsLoopback returns true if ip is a loopback address. // IsLoopback reports whether ip is a loopback address.
func (ip IP) IsLoopback() bool { func (ip IP) IsLoopback() bool {
if ip4 := ip.To4(); ip4 != nil && ip4[0] == 127 { if ip4 := ip.To4(); ip4 != nil && ip4[0] == 127 {
return true return true
...@@ -124,7 +124,7 @@ func (ip IP) IsLoopback() bool { ...@@ -124,7 +124,7 @@ func (ip IP) IsLoopback() bool {
return ip.Equal(IPv6loopback) return ip.Equal(IPv6loopback)
} }
// IsMulticast returns true if ip is a multicast address. // IsMulticast reports whether ip is a multicast address.
func (ip IP) IsMulticast() bool { func (ip IP) IsMulticast() bool {
if ip4 := ip.To4(); ip4 != nil && ip4[0]&0xf0 == 0xe0 { if ip4 := ip.To4(); ip4 != nil && ip4[0]&0xf0 == 0xe0 {
return true return true
...@@ -132,13 +132,13 @@ func (ip IP) IsMulticast() bool { ...@@ -132,13 +132,13 @@ func (ip IP) IsMulticast() bool {
return ip[0] == 0xff return ip[0] == 0xff
} }
// IsInterfaceLocalMulticast returns true if ip is // IsInterfaceLocalMulticast reports whether ip is
// an interface-local multicast address. // an interface-local multicast address.
func (ip IP) IsInterfaceLocalMulticast() bool { func (ip IP) IsInterfaceLocalMulticast() bool {
return len(ip) == IPv6len && ip[0] == 0xff && ip[1]&0x0f == 0x01 return len(ip) == IPv6len && ip[0] == 0xff && ip[1]&0x0f == 0x01
} }
// IsLinkLocalMulticast returns true if ip is a link-local // IsLinkLocalMulticast reports whether ip is a link-local
// multicast address. // multicast address.
func (ip IP) IsLinkLocalMulticast() bool { func (ip IP) IsLinkLocalMulticast() bool {
if ip4 := ip.To4(); ip4 != nil && ip4[0] == 224 && ip4[1] == 0 && ip4[2] == 0 { if ip4 := ip.To4(); ip4 != nil && ip4[0] == 224 && ip4[1] == 0 && ip4[2] == 0 {
...@@ -147,7 +147,7 @@ func (ip IP) IsLinkLocalMulticast() bool { ...@@ -147,7 +147,7 @@ func (ip IP) IsLinkLocalMulticast() bool {
return ip[0] == 0xff && ip[1]&0x0f == 0x02 return ip[0] == 0xff && ip[1]&0x0f == 0x02
} }
// IsLinkLocalUnicast returns true if ip is a link-local // IsLinkLocalUnicast reports whether ip is a link-local
// unicast address. // unicast address.
func (ip IP) IsLinkLocalUnicast() bool { func (ip IP) IsLinkLocalUnicast() bool {
if ip4 := ip.To4(); ip4 != nil && ip4[0] == 169 && ip4[1] == 254 { if ip4 := ip.To4(); ip4 != nil && ip4[0] == 169 && ip4[1] == 254 {
...@@ -156,7 +156,7 @@ func (ip IP) IsLinkLocalUnicast() bool { ...@@ -156,7 +156,7 @@ func (ip IP) IsLinkLocalUnicast() bool {
return ip[0] == 0xfe && ip[1]&0xc0 == 0x80 return ip[0] == 0xfe && ip[1]&0xc0 == 0x80
} }
// IsGlobalUnicast returns true if ip is a global unicast // IsGlobalUnicast reports whether ip is a global unicast
// address. // address.
func (ip IP) IsGlobalUnicast() bool { func (ip IP) IsGlobalUnicast() bool {
return !ip.IsUnspecified() && return !ip.IsUnspecified() &&
...@@ -352,7 +352,7 @@ func (ip *IP) UnmarshalText(text []byte) error { ...@@ -352,7 +352,7 @@ func (ip *IP) UnmarshalText(text []byte) error {
return nil return nil
} }
// Equal returns true if ip and x are the same IP address. // Equal reports whether ip and x are the same IP address.
// An IPv4 address and that same address in IPv6 form are // An IPv4 address and that same address in IPv6 form are
// considered to be equal. // considered to be equal.
func (ip IP) Equal(x IP) bool { func (ip IP) Equal(x IP) bool {
......
...@@ -428,7 +428,7 @@ var atextChars = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZ" + ...@@ -428,7 +428,7 @@ var atextChars = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
"0123456789" + "0123456789" +
"!#$%&'*+-/=?^_`{|}~") "!#$%&'*+-/=?^_`{|}~")
// isAtext returns true if c is an RFC 5322 atext character. // isAtext reports whether c is an RFC 5322 atext character.
// If dot is true, period is included. // If dot is true, period is included.
func isAtext(c byte, dot bool) bool { func isAtext(c byte, dot bool) bool {
if dot && c == '.' { if dot && c == '.' {
...@@ -437,7 +437,7 @@ func isAtext(c byte, dot bool) bool { ...@@ -437,7 +437,7 @@ func isAtext(c byte, dot bool) bool {
return bytes.IndexByte(atextChars, c) >= 0 return bytes.IndexByte(atextChars, c) >= 0
} }
// isQtext returns true if c is an RFC 5322 qtext character. // isQtext reports whether c is an RFC 5322 qtext character.
func isQtext(c byte) bool { func isQtext(c byte) bool {
// Printable US-ASCII, excluding backslash or quote. // Printable US-ASCII, excluding backslash or quote.
if c == '\\' || c == '"' { if c == '\\' || c == '"' {
...@@ -446,13 +446,13 @@ func isQtext(c byte) bool { ...@@ -446,13 +446,13 @@ func isQtext(c byte) bool {
return '!' <= c && c <= '~' return '!' <= c && c <= '~'
} }
// isVchar returns true if c is an RFC 5322 VCHAR character. // isVchar reports whether c is an RFC 5322 VCHAR character.
func isVchar(c byte) bool { func isVchar(c byte) bool {
// Visible (printing) characters. // Visible (printing) characters.
return '!' <= c && c <= '~' return '!' <= c && c <= '~'
} }
// isWSP returns true if c is a WSP (white space). // isWSP reports whether c is a WSP (white space).
// WSP is a space or horizontal tab (RFC5234 Appendix B). // WSP is a space or horizontal tab (RFC5234 Appendix B).
func isWSP(c byte) bool { func isWSP(c byte) bool {
return c == ' ' || c == '\t' return c == ' ' || c == '\t'
......
...@@ -639,7 +639,7 @@ func resolvePath(base, ref string) string { ...@@ -639,7 +639,7 @@ func resolvePath(base, ref string) string {
return "/" + strings.TrimLeft(strings.Join(dst, "/"), "/") return "/" + strings.TrimLeft(strings.Join(dst, "/"), "/")
} }
// IsAbs returns true if the URL is absolute. // IsAbs reports whether the URL is absolute.
func (u *URL) IsAbs() bool { func (u *URL) IsAbs() bool {
return u.Scheme != "" return u.Scheme != ""
} }
......
...@@ -9,7 +9,7 @@ const ( ...@@ -9,7 +9,7 @@ const (
PathListSeparator = '\000' // OS-specific path list separator PathListSeparator = '\000' // OS-specific path list separator
) )
// IsPathSeparator returns true if c is a directory separator character. // IsPathSeparator reports whether c is a directory separator character.
func IsPathSeparator(c uint8) bool { func IsPathSeparator(c uint8) bool {
return PathSeparator == c return PathSeparator == c
} }
...@@ -11,7 +11,7 @@ const ( ...@@ -11,7 +11,7 @@ const (
PathListSeparator = ':' // OS-specific path list separator PathListSeparator = ':' // OS-specific path list separator
) )
// IsPathSeparator returns true if c is a directory separator character. // IsPathSeparator reports whether c is a directory separator character.
func IsPathSeparator(c uint8) bool { func IsPathSeparator(c uint8) bool {
return PathSeparator == c return PathSeparator == c
} }
...@@ -9,7 +9,7 @@ const ( ...@@ -9,7 +9,7 @@ const (
PathListSeparator = ';' // OS-specific path list separator PathListSeparator = ';' // OS-specific path list separator
) )
// IsPathSeparator returns true if c is a directory separator character. // IsPathSeparator reports whether c is a directory separator character.
func IsPathSeparator(c uint8) bool { func IsPathSeparator(c uint8) bool {
// NOTE: Windows accept / as path separator. // NOTE: Windows accept / as path separator.
return c == '\\' || c == '/' return c == '\\' || c == '/'
......
...@@ -16,7 +16,7 @@ import ( ...@@ -16,7 +16,7 @@ import (
// ErrBadPattern indicates a globbing pattern was malformed. // ErrBadPattern indicates a globbing pattern was malformed.
var ErrBadPattern = errors.New("syntax error in pattern") var ErrBadPattern = errors.New("syntax error in pattern")
// Match returns true if name matches the shell file name pattern. // Match reports whether name matches the shell file name pattern.
// The pattern syntax is: // The pattern syntax is:
// //
// pattern: // pattern:
...@@ -301,7 +301,7 @@ func glob(dir, pattern string, matches []string) (m []string, e error) { ...@@ -301,7 +301,7 @@ func glob(dir, pattern string, matches []string) (m []string, e error) {
return return
} }
// hasMeta returns true if path contains any of the magic characters // hasMeta reports whether path contains any of the magic characters
// recognized by Match. // recognized by Match.
func hasMeta(path string) bool { func hasMeta(path string) bool {
// TODO(niemeyer): Should other magic characters be added here? // TODO(niemeyer): Should other magic characters be added here?
......
...@@ -6,7 +6,7 @@ package filepath ...@@ -6,7 +6,7 @@ package filepath
import "strings" import "strings"
// IsAbs returns true if the path is absolute. // IsAbs reports whether the path is absolute.
func IsAbs(path string) bool { func IsAbs(path string) bool {
return strings.HasPrefix(path, "/") || strings.HasPrefix(path, "#") return strings.HasPrefix(path, "/") || strings.HasPrefix(path, "#")
} }
......
...@@ -8,7 +8,7 @@ package filepath ...@@ -8,7 +8,7 @@ package filepath
import "strings" import "strings"
// IsAbs returns true if the path is absolute. // IsAbs reports whether the path is absolute.
func IsAbs(path string) bool { func IsAbs(path string) bool {
return strings.HasPrefix(path, "/") return strings.HasPrefix(path, "/")
} }
......
...@@ -13,7 +13,7 @@ func isSlash(c uint8) bool { ...@@ -13,7 +13,7 @@ func isSlash(c uint8) bool {
return c == '\\' || c == '/' return c == '\\' || c == '/'
} }
// IsAbs returns true if the path is absolute. // IsAbs reports whether the path is absolute.
func IsAbs(path string) (b bool) { func IsAbs(path string) (b bool) {
l := volumeNameLen(path) l := volumeNameLen(path)
if l == 0 { if l == 0 {
...@@ -141,7 +141,7 @@ func joinNonEmpty(elem []string) string { ...@@ -141,7 +141,7 @@ func joinNonEmpty(elem []string) string {
return head + string(Separator) + tail return head + string(Separator) + tail
} }
// isUNC returns true if path is a UNC path. // isUNC reports whether path is a UNC path.
func isUNC(path string) bool { func isUNC(path string) bool {
return volumeNameLen(path) > 2 return volumeNameLen(path) > 2
} }
...@@ -13,7 +13,7 @@ import ( ...@@ -13,7 +13,7 @@ import (
// ErrBadPattern indicates a globbing pattern was malformed. // ErrBadPattern indicates a globbing pattern was malformed.
var ErrBadPattern = errors.New("syntax error in pattern") var ErrBadPattern = errors.New("syntax error in pattern")
// Match returns true if name matches the shell file name pattern. // Match reports whether name matches the shell file name pattern.
// The pattern syntax is: // The pattern syntax is:
// //
// pattern: // pattern:
......
...@@ -192,7 +192,7 @@ func Base(path string) string { ...@@ -192,7 +192,7 @@ func Base(path string) string {
return path return path
} }
// IsAbs returns true if the path is absolute. // IsAbs reports whether the path is absolute.
func IsAbs(path string) bool { func IsAbs(path string) bool {
return len(path) > 0 && path[0] == '/' return len(path) > 0 && path[0] == '/'
} }
......
...@@ -87,16 +87,16 @@ type Type interface { ...@@ -87,16 +87,16 @@ type Type interface {
// Kind returns the specific kind of this type. // Kind returns the specific kind of this type.
Kind() Kind Kind() Kind
// Implements returns true if the type implements the interface type u. // Implements reports whether the type implements the interface type u.
Implements(u Type) bool Implements(u Type) bool
// AssignableTo returns true if a value of the type is assignable to type u. // AssignableTo reports whether a value of the type is assignable to type u.
AssignableTo(u Type) bool AssignableTo(u Type) bool
// ConvertibleTo returns true if a value of the type is convertible to type u. // ConvertibleTo reports whether a value of the type is convertible to type u.
ConvertibleTo(u Type) bool ConvertibleTo(u Type) bool
// Comparable returns true if values of this type are comparable. // Comparable reports whether values of this type are comparable.
Comparable() bool Comparable() bool
// Methods applicable only to some types, depending on Kind. // Methods applicable only to some types, depending on Kind.
...@@ -120,7 +120,7 @@ type Type interface { ...@@ -120,7 +120,7 @@ type Type interface {
// It panics if the type's Kind is not Chan. // It panics if the type's Kind is not Chan.
ChanDir() ChanDir ChanDir() ChanDir
// IsVariadic returns true if a function type's final input parameter // IsVariadic reports whether a function type's final input parameter
// is a "..." parameter. If so, t.In(t.NumIn() - 1) returns the parameter's // is a "..." parameter. If so, t.In(t.NumIn() - 1) returns the parameter's
// implicit actual type []T. // implicit actual type []T.
// //
...@@ -1122,7 +1122,7 @@ func (t *rtype) Comparable() bool { ...@@ -1122,7 +1122,7 @@ func (t *rtype) Comparable() bool {
return t.alg != nil && t.alg.equal != nil return t.alg != nil && t.alg.equal != nil
} }
// implements returns true if the type V implements the interface type T. // implements reports whether the type V implements the interface type T.
func implements(T, V *rtype) bool { func implements(T, V *rtype) bool {
if T.Kind() != Interface { if T.Kind() != Interface {
return false return false
...@@ -1176,7 +1176,7 @@ func implements(T, V *rtype) bool { ...@@ -1176,7 +1176,7 @@ func implements(T, V *rtype) bool {
return false return false
} }
// directlyAssignable returns true if a value x of type V can be directly // directlyAssignable reports whether a value x of type V can be directly
// assigned (using memmove) to a value of type T. // assigned (using memmove) to a value of type T.
// http://golang.org/doc/go_spec.html#Assignability // http://golang.org/doc/go_spec.html#Assignability
// Ignoring the interface rules (implemented elsewhere) // Ignoring the interface rules (implemented elsewhere)
......
...@@ -268,7 +268,7 @@ func (v Value) runes() []rune { ...@@ -268,7 +268,7 @@ func (v Value) runes() []rune {
return *(*[]rune)(v.ptr) return *(*[]rune)(v.ptr)
} }
// CanAddr returns true if the value's address can be obtained with Addr. // CanAddr reports whether the value's address can be obtained with Addr.
// Such values are called addressable. A value is addressable if it is // Such values are called addressable. A value is addressable if it is
// an element of a slice, an element of an addressable array, // an element of a slice, an element of an addressable array,
// a field of an addressable struct, or the result of dereferencing a pointer. // a field of an addressable struct, or the result of dereferencing a pointer.
...@@ -277,7 +277,7 @@ func (v Value) CanAddr() bool { ...@@ -277,7 +277,7 @@ func (v Value) CanAddr() bool {
return v.flag&flagAddr != 0 return v.flag&flagAddr != 0
} }
// CanSet returns true if the value of v can be changed. // CanSet reports whether the value of v can be changed.
// A Value can be changed only if it is addressable and was not // A Value can be changed only if it is addressable and was not
// obtained by the use of unexported struct fields. // obtained by the use of unexported struct fields.
// If CanSet returns false, calling Set or any type-specific // If CanSet returns false, calling Set or any type-specific
...@@ -884,7 +884,7 @@ func (v Value) Int() int64 { ...@@ -884,7 +884,7 @@ func (v Value) Int() int64 {
panic(&ValueError{"reflect.Value.Int", v.kind()}) panic(&ValueError{"reflect.Value.Int", v.kind()})
} }
// CanInterface returns true if Interface can be used without panicking. // CanInterface reports whether Interface can be used without panicking.
func (v Value) CanInterface() bool { func (v Value) CanInterface() bool {
if v.flag == 0 { if v.flag == 0 {
panic(&ValueError{"reflect.Value.CanInterface", Invalid}) panic(&ValueError{"reflect.Value.CanInterface", Invalid})
...@@ -971,7 +971,7 @@ func (v Value) IsNil() bool { ...@@ -971,7 +971,7 @@ func (v Value) IsNil() bool {
panic(&ValueError{"reflect.Value.IsNil", v.kind()}) panic(&ValueError{"reflect.Value.IsNil", v.kind()})
} }
// IsValid returns true if v represents a value. // IsValid reports whether v represents a value.
// It returns false if v is the zero Value. // It returns false if v is the zero Value.
// If IsValid returns false, all other methods except String panic. // If IsValid returns false, all other methods except String panic.
// Most functions and methods never return an invalid value. // Most functions and methods never return an invalid value.
...@@ -1148,7 +1148,7 @@ func (v Value) NumField() int { ...@@ -1148,7 +1148,7 @@ func (v Value) NumField() int {
return len(tt.fields) return len(tt.fields)
} }
// OverflowComplex returns true if the complex128 x cannot be represented by v's type. // OverflowComplex reports whether the complex128 x cannot be represented by v's type.
// It panics if v's Kind is not Complex64 or Complex128. // It panics if v's Kind is not Complex64 or Complex128.
func (v Value) OverflowComplex(x complex128) bool { func (v Value) OverflowComplex(x complex128) bool {
k := v.kind() k := v.kind()
...@@ -1161,7 +1161,7 @@ func (v Value) OverflowComplex(x complex128) bool { ...@@ -1161,7 +1161,7 @@ func (v Value) OverflowComplex(x complex128) bool {
panic(&ValueError{"reflect.Value.OverflowComplex", v.kind()}) panic(&ValueError{"reflect.Value.OverflowComplex", v.kind()})
} }
// OverflowFloat returns true if the float64 x cannot be represented by v's type. // OverflowFloat reports whether the float64 x cannot be represented by v's type.
// It panics if v's Kind is not Float32 or Float64. // It panics if v's Kind is not Float32 or Float64.
func (v Value) OverflowFloat(x float64) bool { func (v Value) OverflowFloat(x float64) bool {
k := v.kind() k := v.kind()
...@@ -1181,7 +1181,7 @@ func overflowFloat32(x float64) bool { ...@@ -1181,7 +1181,7 @@ func overflowFloat32(x float64) bool {
return math.MaxFloat32 < x && x <= math.MaxFloat64 return math.MaxFloat32 < x && x <= math.MaxFloat64
} }
// OverflowInt returns true if the int64 x cannot be represented by v's type. // OverflowInt reports whether the int64 x cannot be represented by v's type.
// It panics if v's Kind is not Int, Int8, int16, Int32, or Int64. // It panics if v's Kind is not Int, Int8, int16, Int32, or Int64.
func (v Value) OverflowInt(x int64) bool { func (v Value) OverflowInt(x int64) bool {
k := v.kind() k := v.kind()
...@@ -1194,7 +1194,7 @@ func (v Value) OverflowInt(x int64) bool { ...@@ -1194,7 +1194,7 @@ func (v Value) OverflowInt(x int64) bool {
panic(&ValueError{"reflect.Value.OverflowInt", v.kind()}) panic(&ValueError{"reflect.Value.OverflowInt", v.kind()})
} }
// OverflowUint returns true if the uint64 x cannot be represented by v's type. // OverflowUint reports whether the uint64 x cannot be represented by v's type.
// It panics if v's Kind is not Uint, Uintptr, Uint8, Uint16, Uint32, or Uint64. // It panics if v's Kind is not Uint, Uintptr, Uint8, Uint16, Uint32, or Uint64.
func (v Value) OverflowUint(x uint64) bool { func (v Value) OverflowUint(x uint64) bool {
k := v.kind() k := v.kind()
...@@ -1647,7 +1647,7 @@ func (v Value) TryRecv() (x Value, ok bool) { ...@@ -1647,7 +1647,7 @@ func (v Value) TryRecv() (x Value, ok bool) {
// TrySend attempts to send x on the channel v but will not block. // TrySend attempts to send x on the channel v but will not block.
// It panics if v's Kind is not Chan. // It panics if v's Kind is not Chan.
// It returns true if the value was sent, false otherwise. // It reports whether the value was sent.
// As in Go, x's value must be assignable to the channel's element type. // As in Go, x's value must be assignable to the channel's element type.
func (v Value) TrySend(x Value) bool { func (v Value) TrySend(x Value) bool {
v.mustBe(Chan) v.mustBe(Chan)
......
...@@ -189,7 +189,7 @@ Loop: ...@@ -189,7 +189,7 @@ Loop:
const noMatch = -1 const noMatch = -1
// MatchRune returns true if the instruction matches (and consumes) r. // MatchRune reports whether the instruction matches (and consumes) r.
// It should only be called when i.Op == InstRune. // It should only be called when i.Op == InstRune.
func (i *Inst) MatchRune(r rune) bool { func (i *Inst) MatchRune(r rune) bool {
return i.MatchRunePos(r) != noMatch return i.MatchRunePos(r) != noMatch
...@@ -256,7 +256,7 @@ func wordRune(r rune) bool { ...@@ -256,7 +256,7 @@ func wordRune(r rune) bool {
('0' <= r && r <= '9') ('0' <= r && r <= '9')
} }
// MatchEmptyWidth returns true if the instruction matches // MatchEmptyWidth reports whether the instruction matches
// an empty string between the runes before and after. // an empty string between the runes before and after.
// It should only be called when i.Op == InstEmptyWidth. // It should only be called when i.Op == InstEmptyWidth.
func (i *Inst) MatchEmptyWidth(before rune, after rune) bool { func (i *Inst) MatchEmptyWidth(before rune, after rune) bool {
......
...@@ -646,7 +646,7 @@ func topofstack(f *_func) bool { ...@@ -646,7 +646,7 @@ func topofstack(f *_func) bool {
externalthreadhandlerp != 0 && pc == externalthreadhandlerp externalthreadhandlerp != 0 && pc == externalthreadhandlerp
} }
// isSystemGoroutine returns true if the goroutine g must be omitted in // isSystemGoroutine reports whether the goroutine g must be omitted in
// stack dumps and deadlock detector. // stack dumps and deadlock detector.
func isSystemGoroutine(gp *g) bool { func isSystemGoroutine(gp *g) bool {
pc := gp.startpc pc := gp.startpc
......
...@@ -256,7 +256,7 @@ var uint64pow10 = [...]uint64{ ...@@ -256,7 +256,7 @@ var uint64pow10 = [...]uint64{
} }
// AssignDecimal sets f to an approximate value mantissa*10^exp. It // AssignDecimal sets f to an approximate value mantissa*10^exp. It
// returns true if the value represented by f is guaranteed to be the // reports whether the value represented by f is guaranteed to be the
// best approximation of d after being rounded to a float64 or // best approximation of d after being rounded to a float64 or
// float32 depending on flt. // float32 depending on flt.
func (f *extFloat) AssignDecimal(mantissa uint64, exp10 int, neg bool, trunc bool, flt *floatInfo) (ok bool) { func (f *extFloat) AssignDecimal(mantissa uint64, exp10 int, neg bool, trunc bool, flt *floatInfo) (ok bool) {
......
...@@ -126,17 +126,17 @@ func Count(s, sep string) int { ...@@ -126,17 +126,17 @@ func Count(s, sep string) int {
return n return n
} }
// Contains returns true if substr is within s. // Contains reports whether substr is within s.
func Contains(s, substr string) bool { func Contains(s, substr string) bool {
return Index(s, substr) >= 0 return Index(s, substr) >= 0
} }
// ContainsAny returns true if any Unicode code points in chars are within s. // ContainsAny reports whether any Unicode code points in chars are within s.
func ContainsAny(s, chars string) bool { func ContainsAny(s, chars string) bool {
return IndexAny(s, chars) >= 0 return IndexAny(s, chars) >= 0
} }
// ContainsRune returns true if the Unicode code point r is within s. // ContainsRune reports whether the Unicode code point r is within s.
func ContainsRune(s string, r rune) bool { func ContainsRune(s string, r rune) bool {
return IndexRune(s, r) >= 0 return IndexRune(s, r) >= 0
} }
......
...@@ -43,7 +43,7 @@ type Position struct { ...@@ -43,7 +43,7 @@ type Position struct {
Column int // column number, starting at 1 (character count per line) Column int // column number, starting at 1 (character count per line)
} }
// IsValid returns true if the position is valid. // IsValid reports whether the position is valid.
func (pos *Position) IsValid() bool { return pos.Line > 0 } func (pos *Position) IsValid() bool { return pos.Line > 0 }
func (pos Position) String() string { func (pos Position) String() string {
......
...@@ -288,7 +288,7 @@ var longMonthNames = []string{ ...@@ -288,7 +288,7 @@ var longMonthNames = []string{
"December", "December",
} }
// match returns true if s1 and s2 match ignoring case. // match reports whether s1 and s2 match ignoring case.
// It is assumed s1 and s2 are the same length. // It is assumed s1 and s2 are the same length.
func match(s1, s2 string) bool { func match(s1, s2 string) bool {
for i := 0; i < len(s1); i++ { for i := 0; i < len(s1); i++ {
...@@ -620,8 +620,7 @@ func (e *ParseError) Error() string { ...@@ -620,8 +620,7 @@ func (e *ParseError) Error() string {
quote(e.Value) + e.Message quote(e.Value) + e.Message
} }
// isDigit returns true if s[i] is a decimal digit, false if not or // isDigit reports whether s[i] is in range and is a decimal digit.
// if s[i] is out of range.
func isDigit(s string, i int) bool { func isDigit(s string, i int) bool {
if len(s) <= i { if len(s) <= i {
return false return false
......
...@@ -25,7 +25,7 @@ const ( ...@@ -25,7 +25,7 @@ const (
surrSelf = 0x10000 surrSelf = 0x10000
) )
// IsSurrogate returns true if the specified Unicode code point // IsSurrogate reports whether the specified Unicode code point
// can appear in a surrogate pair. // can appear in a surrogate pair.
func IsSurrogate(r rune) bool { func IsSurrogate(r rune) bool {
return surr1 <= r && r < surr3 return surr1 <= r && r < surr3
......
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