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) {
}
}
// 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 {
return fh.CompressedSize64 > uint32max || fh.UncompressedSize64 > uint32max
}
......
......@@ -1042,7 +1042,7 @@ func (tr *TypeRepr) String() string {
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 {
return len(tr.Repr) == 0
}
......
......@@ -87,7 +87,7 @@ type Name struct {
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 {
return n.Kind == "var" || n.Kind == "fpvar"
}
......
......@@ -55,7 +55,7 @@ func error_(pos token.Pos, msg string, args ...interface{}) {
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 {
for i, v := range s {
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{})) {
after(x)
}
// imports returns true if f imports path.
// imports reports whether f imports path.
func imports(f *ast.File, path string) bool {
return importSpec(f, path) != nil
}
......@@ -322,33 +322,33 @@ func declImports(gen *ast.GenDecl, path string) bool {
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.
func isPkgDot(t ast.Expr, pkg, name string) bool {
sel, ok := t.(*ast.SelectorExpr)
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.
func isPtrPkgDot(t ast.Expr, pkg, name string) bool {
ptr, ok := t.(*ast.StarExpr)
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 {
id, ok := n.(*ast.Ident)
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 {
id, ok := n.(*ast.Ident)
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 {
call, ok := t.(*ast.CallExpr)
return ok && isPkgDot(call.Fun, pkg, name)
......@@ -360,7 +360,7 @@ func isIdent(n interface{}) *ast.Ident {
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 {
id, ok := n.(*ast.Ident)
// The test of id.Name == x.Name handles top-level unresolved
......@@ -368,12 +368,12 @@ func refersTo(n ast.Node, x *ast.Ident) bool {
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 {
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 {
lit, ok := n.(*ast.BasicLit)
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
}
}
// 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 {
assigned := false
ff := func(n interface{}) {
......
......@@ -176,7 +176,7 @@ func (s *importStack) copy() []string {
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
// that leads to a particular package.
func (sp *importStack) shorterThan(t []string) bool {
......
......@@ -154,7 +154,7 @@ func isWildcard(s string) bool {
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.
// If m == nil, match checks whether pattern == val.
func match(m map[string]reflect.Value, pattern, val reflect.Value) bool {
......
......@@ -24,7 +24,7 @@ import (
type Curve interface {
// Params returns the parameters for the curve.
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
// Add returns the sum of (x1,y1) and (x2,y2)
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.
Receivers should be careful to use Equal to compare MACs in order to avoid
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 {
mac := hmac.New(sha256.New, key)
mac.Write(message)
......
......@@ -238,7 +238,7 @@ Curves:
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 {
c := hs.c
......
......@@ -77,7 +77,7 @@ func (s *CertPool) AddCert(cert *Certificate) {
}
// 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.
//
// 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) {
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 {
return 'a' <= b && b <= 'z' ||
'A' <= b && b <= 'Z' ||
......
......@@ -114,7 +114,7 @@ func (w *Writer) WriteAll(records [][]string) (err error) {
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 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).
......
......@@ -923,7 +923,7 @@ func Parse() {
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 {
return CommandLine.Parsed()
}
......
......@@ -23,8 +23,7 @@ func exportFilter(name string) bool {
// body) are removed. Non-exported fields and methods of exported types are
// stripped. The File.Comments list is not changed.
//
// FileExports returns true if there are exported declarations;
// it returns false otherwise.
// FileExports reports whether there are exported declarations.
//
func FileExports(src *File) bool {
return filterFile(src, exportFilter, true)
......@@ -34,7 +33,7 @@ func FileExports(src *File) bool {
// only exported nodes remain. The pkg.Files list is not changed, so that
// 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.
//
func PackageExports(pkg *Package) bool {
......@@ -199,8 +198,8 @@ func filterSpecList(list []Spec, f Filter, export bool) []Spec {
// all names (including struct field and interface method names, but
// not from parameter lists) that don't pass through the filter f.
//
// FilterDecl returns true if there are any declared names left after
// filtering; it returns false otherwise.
// FilterDecl reports whether there are any declared names left after
// filtering.
//
func FilterDecl(decl Decl, f Filter) bool {
return filterDecl(decl, f, false)
......@@ -224,8 +223,8 @@ func filterDecl(decl Decl, f Filter, export bool) bool {
// the declaration is removed from the AST. Import declarations are
// always removed. The File.Comments list is not changed.
//
// FilterFile returns true if there are any top-level declarations
// left after filtering; it returns false otherwise.
// FilterFile reports whether there are any top-level declarations
// left after filtering.
//
func FilterFile(src *File, f Filter) bool {
return filterFile(src, f, false)
......@@ -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
// lost.
//
// FilterPackage returns true if there are any top-level declarations
// left after filtering; it returns false otherwise.
// FilterPackage reports whether there are any top-level declarations
// left after filtering.
//
func FilterPackage(pkg *Package, f Filter) bool {
return filterPackage(pkg, f, false)
......
......@@ -1228,7 +1228,7 @@ func splitQuoted(s string) (r []string, err error) {
return args, err
}
// match returns true if the name is one of:
// match reports whether the name is one of:
//
// $GOOS
// $GOARCH
......
......@@ -63,7 +63,7 @@ func removeErrorField(ityp *ast.InterfaceType) {
}
// 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
// all remaining fields.
//
......
......@@ -1365,7 +1365,7 @@ func (p *parser) checkExpr(x ast.Expr) ast.Expr {
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 {
switch t := x.(type) {
case *ast.BadExpr:
......@@ -1379,7 +1379,7 @@ func isTypeName(x ast.Expr) bool {
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 {
switch t := x.(type) {
case *ast.BadExpr:
......
......@@ -144,7 +144,7 @@ func (p *printer) nextComment() {
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
// not introduce implicit semicolons.
//
......
......@@ -1165,7 +1165,7 @@ func (p *parser) checkExpr(x ast.Expr) ast.Expr {
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 {
switch t := x.(type) {
case *ast.BadExpr:
......@@ -1179,7 +1179,7 @@ func isTypeName(x ast.Expr) bool {
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 {
switch t := x.(type) {
case *ast.BadExpr:
......
......@@ -24,7 +24,7 @@ type Position struct {
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 }
// String returns a string in one of several forms:
......@@ -77,7 +77,7 @@ type Pos int
//
const NoPos Pos = 0
// IsValid returns true if the position is valid.
// IsValid reports whether the position is valid.
func (p Pos) IsValid() bool {
return p != NoPos
}
......@@ -157,7 +157,7 @@ func (f *File) MergeLine(line int) {
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;
// for instance for the content "ab\nc\n" the line offsets are {0, 3}.
// An empty file has an empty line offset table.
......
......@@ -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 {
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 {
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 {
return x1 > y1 || x1 == y1 && x2 > y2
}
......
......@@ -385,7 +385,7 @@ func (x *Rat) Sign() int {
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 {
return len(x.b.abs) == 0 || x.b.abs.cmp(natOne) == 0
}
......
......@@ -8,13 +8,13 @@ import (
"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.
func isTSpecial(r rune) bool {
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.
func isTokenChar(r rune) bool {
// token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,
......@@ -22,7 +22,7 @@ func isTokenChar(r rune) bool {
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.
func isToken(s string) bool {
if s == "" {
......
......@@ -981,7 +981,7 @@ func statusLine(req *Request, code int) string {
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.
func (w *response) bodyAllowed() bool {
if !w.wroteHeader {
......
......@@ -662,7 +662,7 @@ func (t *Transport) dialConn(cm connectMethod) (*persistConn, error) {
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.
// addr is always a canonicalAddr with a host and port.
func useProxy(addr string) bool {
......
......@@ -108,7 +108,7 @@ var (
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 {
if ip.Equal(IPv4zero) || ip.Equal(IPv6unspecified) {
return true
......@@ -116,7 +116,7 @@ func (ip IP) IsUnspecified() bool {
return false
}
// IsLoopback returns true if ip is a loopback address.
// IsLoopback reports whether ip is a loopback address.
func (ip IP) IsLoopback() bool {
if ip4 := ip.To4(); ip4 != nil && ip4[0] == 127 {
return true
......@@ -124,7 +124,7 @@ func (ip IP) IsLoopback() bool {
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 {
if ip4 := ip.To4(); ip4 != nil && ip4[0]&0xf0 == 0xe0 {
return true
......@@ -132,13 +132,13 @@ func (ip IP) IsMulticast() bool {
return ip[0] == 0xff
}
// IsInterfaceLocalMulticast returns true if ip is
// IsInterfaceLocalMulticast reports whether ip is
// an interface-local multicast address.
func (ip IP) IsInterfaceLocalMulticast() bool {
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.
func (ip IP) IsLinkLocalMulticast() bool {
if ip4 := ip.To4(); ip4 != nil && ip4[0] == 224 && ip4[1] == 0 && ip4[2] == 0 {
......@@ -147,7 +147,7 @@ func (ip IP) IsLinkLocalMulticast() bool {
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.
func (ip IP) IsLinkLocalUnicast() bool {
if ip4 := ip.To4(); ip4 != nil && ip4[0] == 169 && ip4[1] == 254 {
......@@ -156,7 +156,7 @@ func (ip IP) IsLinkLocalUnicast() bool {
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.
func (ip IP) IsGlobalUnicast() bool {
return !ip.IsUnspecified() &&
......@@ -352,7 +352,7 @@ func (ip *IP) UnmarshalText(text []byte) error {
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
// considered to be equal.
func (ip IP) Equal(x IP) bool {
......
......@@ -428,7 +428,7 @@ var atextChars = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
"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.
func isAtext(c byte, dot bool) bool {
if dot && c == '.' {
......@@ -437,7 +437,7 @@ func isAtext(c byte, dot bool) bool {
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 {
// Printable US-ASCII, excluding backslash or quote.
if c == '\\' || c == '"' {
......@@ -446,13 +446,13 @@ func isQtext(c byte) bool {
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 {
// Visible (printing) characters.
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).
func isWSP(c byte) bool {
return c == ' ' || c == '\t'
......
......@@ -639,7 +639,7 @@ func resolvePath(base, ref string) string {
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 {
return u.Scheme != ""
}
......
......@@ -9,7 +9,7 @@ const (
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 {
return PathSeparator == c
}
......@@ -11,7 +11,7 @@ const (
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 {
return PathSeparator == c
}
......@@ -9,7 +9,7 @@ const (
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 {
// NOTE: Windows accept / as path separator.
return c == '\\' || c == '/'
......
......@@ -16,7 +16,7 @@ import (
// ErrBadPattern indicates a globbing pattern was malformed.
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:
//
// pattern:
......@@ -301,7 +301,7 @@ func glob(dir, pattern string, matches []string) (m []string, e error) {
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.
func hasMeta(path string) bool {
// TODO(niemeyer): Should other magic characters be added here?
......
......@@ -6,7 +6,7 @@ package filepath
import "strings"
// IsAbs returns true if the path is absolute.
// IsAbs reports whether the path is absolute.
func IsAbs(path string) bool {
return strings.HasPrefix(path, "/") || strings.HasPrefix(path, "#")
}
......
......@@ -8,7 +8,7 @@ package filepath
import "strings"
// IsAbs returns true if the path is absolute.
// IsAbs reports whether the path is absolute.
func IsAbs(path string) bool {
return strings.HasPrefix(path, "/")
}
......
......@@ -13,7 +13,7 @@ func isSlash(c uint8) bool {
return c == '\\' || c == '/'
}
// IsAbs returns true if the path is absolute.
// IsAbs reports whether the path is absolute.
func IsAbs(path string) (b bool) {
l := volumeNameLen(path)
if l == 0 {
......@@ -141,7 +141,7 @@ func joinNonEmpty(elem []string) string {
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 {
return volumeNameLen(path) > 2
}
......@@ -13,7 +13,7 @@ import (
// ErrBadPattern indicates a globbing pattern was malformed.
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:
//
// pattern:
......
......@@ -192,7 +192,7 @@ func Base(path string) string {
return path
}
// IsAbs returns true if the path is absolute.
// IsAbs reports whether the path is absolute.
func IsAbs(path string) bool {
return len(path) > 0 && path[0] == '/'
}
......
......@@ -87,16 +87,16 @@ type Type interface {
// Kind returns the specific kind of this type.
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
// 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
// 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
// Comparable returns true if values of this type are comparable.
// Comparable reports whether values of this type are comparable.
Comparable() bool
// Methods applicable only to some types, depending on Kind.
......@@ -120,7 +120,7 @@ type Type interface {
// It panics if the type's Kind is not Chan.
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
// implicit actual type []T.
//
......@@ -1122,7 +1122,7 @@ func (t *rtype) Comparable() bool {
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 {
if T.Kind() != Interface {
return false
......@@ -1176,7 +1176,7 @@ func implements(T, V *rtype) bool {
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.
// http://golang.org/doc/go_spec.html#Assignability
// Ignoring the interface rules (implemented elsewhere)
......
......@@ -268,7 +268,7 @@ func (v Value) runes() []rune {
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
// an element of a slice, an element of an addressable array,
// a field of an addressable struct, or the result of dereferencing a pointer.
......@@ -277,7 +277,7 @@ func (v Value) CanAddr() bool {
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
// obtained by the use of unexported struct fields.
// If CanSet returns false, calling Set or any type-specific
......@@ -884,7 +884,7 @@ func (v Value) Int() int64 {
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 {
if v.flag == 0 {
panic(&ValueError{"reflect.Value.CanInterface", Invalid})
......@@ -971,7 +971,7 @@ func (v Value) IsNil() bool {
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.
// If IsValid returns false, all other methods except String panic.
// Most functions and methods never return an invalid value.
......@@ -1148,7 +1148,7 @@ func (v Value) NumField() int {
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.
func (v Value) OverflowComplex(x complex128) bool {
k := v.kind()
......@@ -1161,7 +1161,7 @@ func (v Value) OverflowComplex(x complex128) bool {
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.
func (v Value) OverflowFloat(x float64) bool {
k := v.kind()
......@@ -1181,7 +1181,7 @@ func overflowFloat32(x float64) bool {
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.
func (v Value) OverflowInt(x int64) bool {
k := v.kind()
......@@ -1194,7 +1194,7 @@ func (v Value) OverflowInt(x int64) bool {
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.
func (v Value) OverflowUint(x uint64) bool {
k := v.kind()
......@@ -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.
// 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.
func (v Value) TrySend(x Value) bool {
v.mustBe(Chan)
......
......@@ -189,7 +189,7 @@ Loop:
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.
func (i *Inst) MatchRune(r rune) bool {
return i.MatchRunePos(r) != noMatch
......@@ -256,7 +256,7 @@ func wordRune(r rune) bool {
('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.
// It should only be called when i.Op == InstEmptyWidth.
func (i *Inst) MatchEmptyWidth(before rune, after rune) bool {
......
......@@ -646,7 +646,7 @@ func topofstack(f *_func) bool {
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.
func isSystemGoroutine(gp *g) bool {
pc := gp.startpc
......
......@@ -256,7 +256,7 @@ var uint64pow10 = [...]uint64{
}
// 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
// float32 depending on flt.
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 {
return n
}
// Contains returns true if substr is within s.
// Contains reports whether substr is within s.
func Contains(s, substr string) bool {
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 {
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 {
return IndexRune(s, r) >= 0
}
......
......@@ -43,7 +43,7 @@ type Position struct {
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) String() string {
......
......@@ -288,7 +288,7 @@ var longMonthNames = []string{
"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.
func match(s1, s2 string) bool {
for i := 0; i < len(s1); i++ {
......@@ -620,8 +620,7 @@ func (e *ParseError) Error() string {
quote(e.Value) + e.Message
}
// isDigit returns true if s[i] is a decimal digit, false if not or
// if s[i] is out of range.
// isDigit reports whether s[i] is in range and is a decimal digit.
func isDigit(s string, i int) bool {
if len(s) <= i {
return false
......
......@@ -25,7 +25,7 @@ const (
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.
func IsSurrogate(r rune) bool {
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