]> Cypherpunks.ru repositories - gostls13.git/commitdiff
all: use "reports whether" consistently in the few places that didn't
authorBrad Fitzpatrick <bradfitz@golang.org>
Fri, 2 Nov 2018 15:18:43 +0000 (15:18 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 2 Nov 2018 22:47:58 +0000 (22:47 +0000)
Go documentation style for boolean funcs is to say:

    // Foo reports whether ...
    func Foo() bool

(rather than "returns true if")

This CL also replaces 4 uses of "iff" with the same "reports whether"
wording, which doesn't lose any meaning, and will prevent people from
sending typo fixes when they don't realize it's "if and only if". In
the past I think we've had the typo CLs updated to just say "reports
whether". So do them all at once.

(Inspired by the addition of another "returns true if" in CL 146938
in fd_plan9.go)

Created with:

$ perl -i -npe 's/returns true if/reports whether/' $(git grep -l "returns true iff" | grep -v vendor)
$ perl -i -npe 's/returns true if/reports whether/' $(git grep -l "returns true if" | grep -v vendor)

Change-Id: Ided502237f5ab0d25cb625dbab12529c361a8b9f
Reviewed-on: https://go-review.googlesource.com/c/147037
Reviewed-by: Ian Lance Taylor <iant@golang.org>
47 files changed:
src/cmd/asm/internal/lex/input.go
src/cmd/compile/internal/gc/closure.go
src/cmd/compile/internal/gc/syntax.go
src/cmd/compile/internal/ssa/config.go
src/cmd/compile/internal/ssa/debug.go
src/cmd/compile/internal/ssa/func.go
src/cmd/compile/internal/ssa/gen/genericOps.go
src/cmd/compile/internal/ssa/gen/rulegen.go
src/cmd/compile/internal/ssa/poset.go
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/trim.go
src/cmd/fix/fix.go
src/cmd/internal/dwarf/dwarf.go
src/cmd/trace/annotations.go
src/cmd/vet/print.go
src/crypto/x509/x509.go
src/database/sql/sql.go
src/encoding/asn1/asn1.go
src/go/printer/nodes.go
src/go/types/builtins.go
src/go/types/scope.go
src/go/types/type.go
src/html/template/js.go
src/html/template/url.go
src/internal/poll/fd_plan9.go
src/internal/poll/fd_poll_nacljs.go
src/internal/poll/fd_poll_runtime.go
src/math/big/float.go
src/math/cmplx/isinf.go
src/math/cmplx/isnan.go
src/math/signbit.go
src/os/stat_windows.go
src/path/filepath/match_test.go
src/reflect/type.go
src/regexp/syntax/regexp.go
src/runtime/mbitmap.go
src/runtime/mcentral.go
src/runtime/mgc.go
src/runtime/mgcwork.go
src/runtime/mwbbuf.go
src/runtime/netpoll.go
src/runtime/panic.go
src/runtime/pprof/internal/profile/profile.go
src/runtime/proc.go
src/runtime/signal_windows.go
src/sync/runtime.go
src/syscall/mksyscall_windows.go

index 5186635fe701b32c7d9d48d01a083aa202b9e7c7..a43953b515469852e4a7b4095d32824a5751a4a1 100644 (file)
@@ -139,7 +139,7 @@ func (in *Input) Text() string {
        return in.text
 }
 
-// hash processes a # preprocessor directive. It returns true iff it completes.
+// hash processes a # preprocessor directive. It reports whether it completes.
 func (in *Input) hash() bool {
        // We have a '#'; it must be followed by a known word (define, include, etc.).
        tok := in.Stack.Next()
index ec19f5c112447c78d1a5b54a34e160c815c5a0dd..5123df8e9d15f0dfe6a043bac4d19a429b3f31b1 100644 (file)
@@ -314,7 +314,7 @@ func transformclosure(xfunc *Node) {
        lineno = lno
 }
 
-// hasemptycvars returns true iff closure clo has an
+// hasemptycvars reports whether closure clo has an
 // empty list of captured vars.
 func hasemptycvars(clo *Node) bool {
        xfunc := clo.Func.Closure
index 0fe6defe995d1fa718d7d6185375d4d5e15b4493..e29a3d7657d9b07e11fba669f7079fb3df6fb57e 100644 (file)
@@ -929,7 +929,7 @@ type nodeQueue struct {
        head, tail int
 }
 
-// empty returns true if q contains no Nodes.
+// empty reports whether q contains no Nodes.
 func (q *nodeQueue) empty() bool {
        return q.head == q.tail
 }
index e79629695a4d768857905b2fbb837dc6abeae94c..558c4b7db8fff9ea449d47872cb4f5d44b94ca97 100644 (file)
@@ -112,7 +112,7 @@ type Logger interface {
        // Logf logs a message from the compiler.
        Logf(string, ...interface{})
 
-       // Log returns true if logging is not a no-op
+       // Log reports whether logging is not a no-op
        // some logging calls account for more than a few heap allocations.
        Log() bool
 
index 8df8a94b7666a8241fe28f4a498d60d6bb63bdc6..3d0be0fe1c8992d84a91676ffe12764fbdc5432f 100644 (file)
@@ -790,7 +790,7 @@ func (e *pendingEntry) clear() {
        }
 }
 
-// canMerge returns true if the location description for new is the same as
+// canMerge reports whether the location description for new is the same as
 // pending.
 func canMerge(pending, new VarLoc) bool {
        if pending.absent() && new.absent() {
index 2ed4086fd1957e41c4db94228fdcad069f7f8890..d73d39ce288f51d1c697704b4b1f79aa4415e9f8 100644 (file)
@@ -621,7 +621,7 @@ func (f *Func) invalidateCFG() {
        f.cachedLoopnest = nil
 }
 
-// DebugHashMatch returns true if environment variable evname
+// DebugHashMatch reports whether environment variable evname
 // 1) is empty (this is a special more-quickly implemented case of 3)
 // 2) is "y" or "Y"
 // 3) is a suffix of the sha1 hash of name
index 522ccbf893f520166830f1314b86a57183e568c5..ba8d93cf2cc6952f7b2f2ffd1ddaf04be3f5b010 100644 (file)
@@ -529,7 +529,7 @@ var genericOps = []opData{
        {name: "AtomicAdd64", argLength: 3, typ: "(UInt64,Mem)", hasSideEffects: true},             // Do *arg0 += arg1.  arg2=memory.  Returns sum and new memory.
        {name: "AtomicCompareAndSwap32", argLength: 4, typ: "(Bool,Mem)", hasSideEffects: true},    // if *arg0==arg1, then set *arg0=arg2.  Returns true if store happens and new memory.
        {name: "AtomicCompareAndSwap64", argLength: 4, typ: "(Bool,Mem)", hasSideEffects: true},    // if *arg0==arg1, then set *arg0=arg2.  Returns true if store happens and new memory.
-       {name: "AtomicCompareAndSwapRel32", argLength: 4, typ: "(Bool,Mem)", hasSideEffects: true}, // if *arg0==arg1, then set *arg0=arg2.  Lock release, returns true if store happens and new memory.
+       {name: "AtomicCompareAndSwapRel32", argLength: 4, typ: "(Bool,Mem)", hasSideEffects: true}, // if *arg0==arg1, then set *arg0=arg2.  Lock release, reports whether store happens and new memory.
        {name: "AtomicAnd8", argLength: 3, typ: "Mem", hasSideEffects: true},                       // *arg0 &= arg1.  arg2=memory.  Returns memory.
        {name: "AtomicOr8", argLength: 3, typ: "Mem", hasSideEffects: true},                        // *arg0 |= arg1.  arg2=memory.  Returns memory.
 
index faaad974c4a393a5fa7f2f8a25f5da3f8a6c0e66..34517b4cb9aa81d9ea0a63a415f5fa0962dc4983 100644 (file)
@@ -6,7 +6,7 @@
 
 // This program generates Go code that applies rewrite rules to a Value.
 // The generated code implements a function of type func (v *Value) bool
-// which returns true iff if did something.
+// which reports whether if did something.
 // Ideas stolen from Swift: http://www.hpl.hp.com/techreports/Compaq-DEC/WRL-2000-2.html
 
 package main
@@ -386,7 +386,7 @@ func genRules(arch arch) {
        }
 }
 
-// genMatch returns true if the match can fail.
+// genMatch reports whether the match can fail.
 func genMatch(w io.Writer, arch arch, match string, loc string) bool {
        return genMatch0(w, arch, match, "v", map[string]struct{}{}, true, loc)
 }
@@ -623,7 +623,7 @@ outer:
        return r
 }
 
-// isBlock returns true if this op is a block opcode.
+// isBlock reports whether this op is a block opcode.
 func isBlock(name string, arch arch) bool {
        for _, b := range genericBlocks {
                if b.name == name {
@@ -768,7 +768,7 @@ func typeName(typ string) string {
        }
 }
 
-// unbalanced returns true if there aren't the same number of ( and ) in the string.
+// unbalanced reports whether there aren't the same number of ( and ) in the string.
 func unbalanced(s string) bool {
        var left, right int
        for _, c := range s {
index 0e0e2789b148b281ac7d87f0fc0f02f2cfb53827..4ebfb89e52b1eda63f3e80c4875c4064ec7c3609 100644 (file)
@@ -781,7 +781,7 @@ func (po *poset) DotDump(fn string, title string) error {
        return nil
 }
 
-// Ordered returns true if n1<n2. It returns false either when it is
+// Ordered reports whether n1<n2. It returns false either when it is
 // certain that n1<n2 is false, or if there is not enough information
 // to tell.
 // Complexity is O(n).
@@ -799,7 +799,7 @@ func (po *poset) Ordered(n1, n2 *Value) bool {
        return i1 != i2 && po.dominates(i1, i2, true)
 }
 
-// Ordered returns true if n1<=n2. It returns false either when it is
+// Ordered reports whether n1<=n2. It returns false either when it is
 // certain that n1<=n2 is false, or if there is not enough information
 // to tell.
 // Complexity is O(n).
@@ -818,7 +818,7 @@ func (po *poset) OrderedOrEqual(n1, n2 *Value) bool {
                (po.dominates(i2, i1, false) && !po.dominates(i2, i1, true))
 }
 
-// Equal returns true if n1==n2. It returns false either when it is
+// Equal reports whether n1==n2. It returns false either when it is
 // certain that n1==n2 is false, or if there is not enough information
 // to tell.
 // Complexity is O(1).
@@ -832,7 +832,7 @@ func (po *poset) Equal(n1, n2 *Value) bool {
        return f1 && f2 && i1 == i2
 }
 
-// NonEqual returns true if n1!=n2. It returns false either when it is
+// NonEqual reports whether n1!=n2. It returns false either when it is
 // certain that n1!=n2 is false, or if there is not enough information
 // to tell.
 // Complexity is O(n) (because it internally calls Ordered to see if we
index 13a2da9a2f02d74e106d5b28dcc0b3af1a3c0e6e..ed5bce861e48b8a74a0b9576d5eba2a74f22b033 100644 (file)
@@ -485,7 +485,7 @@ func auxTo64F(i int64) float64 {
        return math.Float64frombits(uint64(i))
 }
 
-// uaddOvf returns true if unsigned a+b would overflow.
+// uaddOvf reports whether unsigned a+b would overflow.
 func uaddOvf(a, b int64) bool {
        return uint64(a)+uint64(b) < uint64(a)
 }
index d97c6baaa1bff73c6b55f97aa03fcb0f9c5f67e4..1293548aad09851065412b8cf6b61d1578756131 100644 (file)
@@ -94,7 +94,7 @@ func trim(f *Func) {
        }
 }
 
-// emptyBlock returns true if the block does not contain actual
+// emptyBlock reports whether the block does not contain actual
 // instructions
 func emptyBlock(b *Block) bool {
        for _, v := range b.Values {
@@ -105,7 +105,7 @@ func emptyBlock(b *Block) bool {
        return true
 }
 
-// trimmableBlock returns true if the block can be trimmed from the CFG,
+// trimmableBlock reports whether the block can be trimmed from the CFG,
 // subject to the following criteria:
 //  - it should not be the first block
 //  - it should be BlockPlain
index 03c828a5816499590a295bd3ef98cb7b72555708..2c64e9b414df418dba1a2c2332d2b327f5f47eab 100644 (file)
@@ -478,7 +478,7 @@ func newPkgDot(pos token.Pos, pkg, name string) ast.Expr {
 }
 
 // renameTop renames all references to the top-level name old.
-// It returns true if it makes any changes.
+// It reports whether it makes any changes.
 func renameTop(f *ast.File, old, new string) bool {
        var fixed bool
 
index 21512a80bdf265c928939e64cb55009f4c35ce9e..8ad84105a4814bbfe7648b51305d94fd2d31fab9 100644 (file)
@@ -967,7 +967,7 @@ Outer:
        }
 }
 
-// HasChildren returns true if 'die' uses an abbrev that supports children.
+// HasChildren reports whether 'die' uses an abbrev that supports children.
 func HasChildren(die *DWDie) bool {
        return abbrevs[die.Abbrev].children != 0
 }
index 9905456b46db74fc1bd5cd8508ea5bb7b01ef5c8..a4933b51bf00d6708519f0fbf7be30122107a34c 100644 (file)
@@ -508,7 +508,7 @@ func (task *taskDesc) overlappingGCDuration(evs []*trace.Event) (overlapping tim
        return overlapping
 }
 
-// overlappingInstant returns true if the instantaneous event, ev, occurred during
+// overlappingInstant reports whether the instantaneous event, ev, occurred during
 // any of the task's region if ev is a goroutine-local event, or overlaps with the
 // task's lifetime if ev is a global event.
 func (task *taskDesc) overlappingInstant(ev *trace.Event) bool {
index a55da1d3c815c78dc7aa8a122374f2bb61f44eee..3a2eea0beba55d5d5d6ff5b08ef503e524452c34 100644 (file)
@@ -531,7 +531,7 @@ func printfNameAndKind(pkg *Package, called ast.Expr) (pkgpath, name string, kin
        return pkgpath, name, kind
 }
 
-// isStringer returns true if the provided declaration is a "String() string"
+// isStringer reports whether the provided declaration is a "String() string"
 // method, an implementation of fmt.Stringer.
 func isStringer(f *File, d *ast.FuncDecl) bool {
        return d.Recv != nil && d.Name.Name == "String" && d.Type.Results != nil &&
index 7e8f675886b10772728b590421d8351b35523ada..b0d366c2458b6e2104362970a139f6350ecd3998 100644 (file)
@@ -1147,7 +1147,7 @@ func parseSANExtension(value []byte) (dnsNames, emailAddresses []string, ipAddre
        return
 }
 
-// isValidIPMask returns true iff mask consists of zero or more 1 bits, followed by zero bits.
+// isValidIPMask reports whether mask consists of zero or more 1 bits, followed by zero bits.
 func isValidIPMask(mask []byte) bool {
        seenZero := false
 
index 16f1c9fce82dee352b2d3ae67d02bd8d96f75774..099701ce7c5a4852293445e30490bfe399955e69 100644 (file)
@@ -2691,7 +2691,7 @@ func (rs *Rows) nextLocked() (doClose, ok bool) {
        return false, true
 }
 
-// NextResultSet prepares the next result set for reading. It returns true if
+// NextResultSet prepares the next result set for reading. It reports whether
 // there is further result sets, or false if there is no further result set
 // or if there is an error advancing to it. The Err method should be consulted
 // to distinguish between the two cases.
index 1ed357adfffccdf5c2d71ca97d339c5752ffc291..3cfd9d1276497fe7196db7eaf55392d68f4bce55 100644 (file)
@@ -633,7 +633,7 @@ var (
        bigIntType           = reflect.TypeOf(new(big.Int))
 )
 
-// invalidLength returns true iff offset + length > sliceLength, or if the
+// invalidLength reports whether offset + length > sliceLength, or if the
 // addition would overflow.
 func invalidLength(offset, length, sliceLength int) bool {
        return offset+length < offset || offset+length > sliceLength
index 1de7cd81b2cd07e621508c4f2185905193bc1377..a307d8395e9d94400a367519049b1843a1cc9e7e 100644 (file)
@@ -1134,7 +1134,7 @@ func (p *printer) controlClause(isForStmt bool, init ast.Stmt, expr ast.Expr, po
 // than starting at the first line break).
 //
 func (p *printer) indentList(list []ast.Expr) bool {
-       // Heuristic: indentList returns true if there are more than one multi-
+       // Heuristic: indentList reports whether there are more than one multi-
        // line element in the list, or if there is any element that is not
        // starting on the same line as the previous one ends.
        if len(list) >= 2 {
index 882c773db41051c963dc471b3ad98c8de9025ae1..ece6d4f530cfe59e146095e6f13b88b74ef705f3 100644 (file)
@@ -13,7 +13,7 @@ import (
 )
 
 // builtin type-checks a call to the built-in specified by id and
-// returns true if the call is valid, with *x holding the result;
+// reports whether the call is valid, with *x holding the result;
 // but x.expr is not set. If the call is invalid, the result is
 // false, and *x is undefined.
 //
index 6cf5cc66f974a2d9e33c138a74edd8dc94ad1086..b50ee2fd5f38d89c4cecc83d7913a8b2aecb5ff5 100644 (file)
@@ -115,7 +115,7 @@ func (s *Scope) Insert(obj Object) Object {
 func (s *Scope) Pos() token.Pos { return s.pos }
 func (s *Scope) End() token.Pos { return s.end }
 
-// Contains returns true if pos is within the scope's extent.
+// Contains reports whether pos is within the scope's extent.
 // The result is guaranteed to be valid only if the type-checked
 // AST has complete position information.
 func (s *Scope) Contains(pos token.Pos) bool {
index 77426ba6187ce8ccc36147b3934fca557eb353de..3dd9eb97f5c0c01220f87463edf3a8c902cf34e4 100644 (file)
@@ -340,7 +340,7 @@ func (t *Interface) NumMethods() int { return len(t.allMethods) }
 // The methods are ordered by their unique Id.
 func (t *Interface) Method(i int) *Func { return t.allMethods[i] }
 
-// Empty returns true if t is the empty interface.
+// Empty reports whether t is the empty interface.
 func (t *Interface) Empty() bool { return len(t.allMethods) == 0 }
 
 // Complete computes the interface's method set. It must be called by users of
index 2291f47c33ed856c560717298000a3b254df552e..98e821b73c8f2f8319694eb5041c08cb80814db6 100644 (file)
@@ -371,7 +371,7 @@ func isJSIdentPart(r rune) bool {
        return false
 }
 
-// isJSType returns true if the given MIME type should be considered JavaScript.
+// isJSType reports whether the given MIME type should be considered JavaScript.
 //
 // It is used to determine whether a script tag with a type attribute is a javascript container.
 func isJSType(mimeType string) bool {
index 8a4f727e50f252cf2c24e2b2ad5c17b3e4760f3f..6f8185a4e90e69a0833c31b8aa4bffdc6ef5bc30 100644 (file)
@@ -86,7 +86,7 @@ func urlProcessor(norm bool, args ...interface{}) string {
 }
 
 // processURLOnto appends a normalized URL corresponding to its input to b
-// and returns true if the appended content differs from s.
+// and reports whether the appended content differs from s.
 func processURLOnto(s string, norm bool, b *bytes.Buffer) bool {
        b.Grow(len(s) + 16)
        written := 0
index fce22859319ee48934a8d9819f2ced10a09f3270..0fce32915e7dd41eda9b6627a295aa52ac6493f7 100644 (file)
@@ -193,7 +193,7 @@ func isInterrupted(err error) bool {
        return err != nil && stringsHasSuffix(err.Error(), "interrupted")
 }
 
-// IsPollDescriptor returns true if fd is the descriptor being used by the poller.
+// IsPollDescriptor reports whether fd is the descriptor being used by the poller.
 // This is only used for testing.
 func IsPollDescriptor(fd uintptr) bool {
        return false
index e0d3f976f15e42059d65801f3b6710ff1ba796cd..0871f342d423b782ec7e7daf848b966ceb1389cb 100644 (file)
@@ -92,7 +92,7 @@ func setDeadlineImpl(fd *FD, t time.Time, mode int) error {
        return nil
 }
 
-// IsPollDescriptor returns true if fd is the descriptor being used by the poller.
+// IsPollDescriptor reports whether fd is the descriptor being used by the poller.
 // This is only used for testing.
 func IsPollDescriptor(fd uintptr) bool {
        return false
index 2ee8e7c2c9e3030ce9399734888188bcb48122c3..687f702556ff0fb0171f51e50f6c2fe7c33b1de2 100644 (file)
@@ -154,7 +154,7 @@ func setDeadlineImpl(fd *FD, t time.Time, mode int) error {
        return nil
 }
 
-// IsPollDescriptor returns true if fd is the descriptor being used by the poller.
+// IsPollDescriptor reports whether fd is the descriptor being used by the poller.
 // This is only used for testing.
 func IsPollDescriptor(fd uintptr) bool {
        return runtime_isPollServerDescriptor(fd)
index d5e801b2c8939519126461c695de640e95f86680..b3c329520141f112f9216ffc0b1d39fe40c7b9cc 100644 (file)
@@ -327,7 +327,7 @@ func (z *Float) SetMantExp(mant *Float, exp int) *Float {
        return z
 }
 
-// Signbit returns true if x is negative or negative zero.
+// Signbit reports whether x is negative or negative zero.
 func (x *Float) Signbit() bool {
        return x.neg
 }
index d5a65b44b320c80da1500a4444907d4e2521c5a1..6273cd3a6c16ba336c4eb8dda082173bde87e342 100644 (file)
@@ -6,7 +6,7 @@ package cmplx
 
 import "math"
 
-// IsInf returns true if either real(x) or imag(x) is an infinity.
+// IsInf reports whether either real(x) or imag(x) is an infinity.
 func IsInf(x complex128) bool {
        if math.IsInf(real(x), 0) || math.IsInf(imag(x), 0) {
                return true
index 05d0cce6335efaef250b2aa94713c442ecb2c08d..d3382c05eefd81030933cde3a389f2ea343cea33 100644 (file)
@@ -6,7 +6,7 @@ package cmplx
 
 import "math"
 
-// IsNaN returns true if either real(x) or imag(x) is NaN
+// IsNaN reports whether either real(x) or imag(x) is NaN
 // and neither is an infinity.
 func IsNaN(x complex128) bool {
        switch {
index 670cc1a66799b5712461385739ddc3313ade75f8..f6e61d660e27d9d8376ecb13c3fe8b535d0acc71 100644 (file)
@@ -4,7 +4,7 @@
 
 package math
 
-// Signbit returns true if x is negative or negative zero.
+// Signbit reports whether x is negative or negative zero.
 func Signbit(x float64) bool {
        return Float64bits(x)&(1<<63) != 0
 }
index f4700f581804c4308501392939891acdbb5d1738..271ff5f8434270622baca85b236997dfa96d5f16 100644 (file)
@@ -10,7 +10,7 @@ import (
        "unsafe"
 )
 
-// isNulName returns true if name is NUL file name.
+// isNulName reports whether name is NUL file name.
 // For example, it returns true for both "NUL" and "nul".
 func isNulName(name string) bool {
        if len(name) != 3 {
index 1d91c274c75966c76f61ef314171e92012b1192c..b8657626bc7ea02c01c0b7967001b259427f55ab 100644 (file)
@@ -106,7 +106,7 @@ func TestMatch(t *testing.T) {
        }
 }
 
-// contains returns true if vector contains the string s.
+// contains reports whether vector contains the string s.
 func contains(vector []string, s string) bool {
        for _, elem := range vector {
                if elem == s {
index d8971d620ef59fd7fee50316099f983ff7225537..a04234ca692825836f416d9cebf05b0cf549866f 100644 (file)
@@ -2314,7 +2314,7 @@ type structTypeFixed32 struct {
        m [32]method
 }
 
-// isLetter returns true if a given 'rune' is classified as a Letter.
+// isLetter reports whether a given 'rune' is classified as a Letter.
 func isLetter(ch rune) bool {
        return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' || ch >= utf8.RuneSelf && unicode.IsLetter(ch)
 }
index a3f56f8c902e4141271052133bdc49a927721b26..ae5fa053f985fec026abe8f25aefa03af22766e9 100644 (file)
@@ -59,7 +59,7 @@ const (
 
 const opPseudo Op = 128 // where pseudo-ops start
 
-// Equal returns true if x and y have identical structure.
+// Equal reports whether x and y have identical structure.
 func (x *Regexp) Equal(y *Regexp) bool {
        if x == nil || y == nil {
                return x == y
index 4854c0e632874dbf893ea49613ac845bf33122dc..67d99900a2fbd044ec6385466410354d6c7e5868 100644 (file)
@@ -517,7 +517,7 @@ func (h heapBits) bits() uint32 {
        return uint32(*h.bitp) >> (h.shift & 31)
 }
 
-// morePointers returns true if this word and all remaining words in this object
+// morePointers reports whether this word and all remaining words in this object
 // are scalars.
 // h must not describe the second word of the object.
 func (h heapBits) morePointers() bool {
index d9bc8b4719403cc776773ff576c8279ca93814e8..f108bfc31e02d59b02e820c96596ce876c403a57 100644 (file)
@@ -203,7 +203,7 @@ func (c *mcentral) uncacheSpan(s *mspan) {
 // and, based on the number of free objects in s,
 // moves s to the appropriate list of c or returns it
 // to the heap.
-// freeSpan returns true if s was returned to the heap.
+// freeSpan reports whether s was returned to the heap.
 // If preserve=true, it does not move s (the caller
 // must take care of it).
 func (c *mcentral) freeSpan(s *mspan, preserve bool, wasempty bool) bool {
index e12df7f7d2055de35ad0ba6113f2c2a127bc3199..f4646db67aac5f99c4a8deed69caeb3ca0d5372f 100644 (file)
@@ -735,7 +735,7 @@ func (c *gcControllerState) findRunnableGCWorker(_p_ *p) *g {
        return gp
 }
 
-// pollFractionalWorkerExit returns true if a fractional mark worker
+// pollFractionalWorkerExit reports whether a fractional mark worker
 // should self-preempt. It assumes it is called from the fractional
 // worker.
 func pollFractionalWorkerExit() bool {
@@ -1157,7 +1157,7 @@ const (
        gcTriggerCycle
 )
 
-// test returns true if the trigger condition is satisfied, meaning
+// test reports whether the trigger condition is satisfied, meaning
 // that the exit condition for the _GCoff phase has been met. The exit
 // condition should be tested when allocating.
 func (t gcTrigger) test() bool {
@@ -1867,7 +1867,7 @@ func gcBgMarkWorker(_p_ *p) {
        }
 }
 
-// gcMarkWorkAvailable returns true if executing a mark worker
+// gcMarkWorkAvailable reports whether executing a mark worker
 // on p is potentially useful. p may be nil, in which case it only
 // checks the global sources of work.
 func gcMarkWorkAvailable(p *p) bool {
index c32c5eddd77f19111056cd013209b3eb152bf04b..f2f20fcdac62608718bfdd2c8ff7fb2655bc77b3 100644 (file)
@@ -138,7 +138,7 @@ func (w *gcWork) put(obj uintptr) {
        }
 }
 
-// putFast does a put and returns true if it can be done quickly
+// putFast does a put and reports whether it can be done quickly
 // otherwise it returns false and the caller needs to call put.
 //go:nowritebarrierrec
 func (w *gcWork) putFast(obj uintptr) bool {
@@ -299,7 +299,7 @@ func (w *gcWork) balance() {
        }
 }
 
-// empty returns true if w has no mark work available.
+// empty reports whether w has no mark work available.
 //go:nowritebarrierrec
 func (w *gcWork) empty() bool {
        return w.wbuf1 == nil || (w.wbuf1.nobj == 0 && w.wbuf2.nobj == 0)
index f35f7286acbad665f7c5ed3c3ecd7e586ad24f4f..c91cea254e9dacefeb1bb194941c899c0400c251 100644 (file)
@@ -107,7 +107,7 @@ func (b *wbBuf) discard() {
        b.next = uintptr(unsafe.Pointer(&b.buf[0]))
 }
 
-// empty returns true if b contains no pointers.
+// empty reports whether b contains no pointers.
 func (b *wbBuf) empty() bool {
        return b.next == uintptr(unsafe.Pointer(&b.buf[0]))
 }
index 75db8c6c2fe3a5e6f2ecfe10f224dc1612b12479..71ca993cc05654129e245f993b757eb21fd71e49 100644 (file)
@@ -95,7 +95,7 @@ func netpollinited() bool {
 
 //go:linkname poll_runtime_isPollServerDescriptor internal/poll.runtime_isPollServerDescriptor
 
-// poll_runtime_isPollServerDescriptor returns true if fd is a
+// poll_runtime_isPollServerDescriptor reports whether fd is a
 // descriptor being used by netpoll.
 func poll_runtime_isPollServerDescriptor(fd uintptr) bool {
        fds := netpolldescriptor()
index 45be886196cf74ee051ae1c04c5840d12003e725..5b989d28e98af75b39b8033122b5d49a30333c1d 100644 (file)
@@ -849,7 +849,7 @@ func canpanic(gp *g) bool {
        return true
 }
 
-// shouldPushSigpanic returns true if pc should be used as sigpanic's
+// shouldPushSigpanic reports whether pc should be used as sigpanic's
 // return PC (pushing a frame for the call). Otherwise, it should be
 // left alone so that LR is used as sigpanic's return PC, effectively
 // replacing the top-most frame with sigpanic. This is used by
@@ -887,7 +887,7 @@ func shouldPushSigpanic(gp *g, pc, lr uintptr) bool {
        return true
 }
 
-// isAbortPC returns true if pc is the program counter at which
+// isAbortPC reports whether pc is the program counter at which
 // runtime.abort raises a signal.
 //
 // It is nosplit because it's part of the isgoexception
index 84e607e9a8ff0af7ba338e73ceea2bf865073b80..a6f8354b1e8ccf4242ec4c1a90faa815591324e2 100644 (file)
@@ -573,7 +573,7 @@ func (p *Profile) Demangle(d Demangler) error {
        return nil
 }
 
-// Empty returns true if the profile contains no samples.
+// Empty reports whether the profile contains no samples.
 func (p *Profile) Empty() bool {
        return len(p.Sample) == 0
 }
index 542cf1ed70255cb0b9b14ffad09cd283369238e4..864efcdfed732d89475ca56e57cbb28498b2103a 100644 (file)
@@ -2400,7 +2400,7 @@ stop:
        goto top
 }
 
-// pollWork returns true if there is non-background work this P could
+// pollWork reports whether there is non-background work this P could
 // be doing. This is a fairly lightweight check to be used for
 // background work loops, like idle GC. It checks a subset of the
 // conditions checked by the actual scheduler.
@@ -4713,7 +4713,7 @@ func pidleget() *p {
        return _p_
 }
 
-// runqempty returns true if _p_ has no Gs on its local run queue.
+// runqempty reports whether _p_ has no Gs on its local run queue.
 // It never returns true spuriously.
 func runqempty(_p_ *p) bool {
        // Defend against a race where 1) _p_ has G1 in runqnext but runqhead == runqtail,
@@ -4934,7 +4934,7 @@ type gQueue struct {
        tail guintptr
 }
 
-// empty returns true if q is empty.
+// empty reports whether q is empty.
 func (q *gQueue) empty() bool {
        return q.head == 0
 }
@@ -5000,7 +5000,7 @@ type gList struct {
        head guintptr
 }
 
-// empty returns true if l is empty.
+// empty reports whether l is empty.
 func (l *gList) empty() bool {
        return l.head == 0
 }
index 873ce66abedde4b053a249ad806a2e887f5bda69..e8a64da657961b9d8ee89ccf7c85aad07dbb8720 100644 (file)
@@ -38,7 +38,7 @@ func initExceptionHandler() {
        }
 }
 
-// isgoexception returns true if this exception should be translated
+// isgoexception reports whether this exception should be translated
 // into a Go panic.
 //
 // It is nosplit to avoid growing the stack in case we're aborting
index a13d9f6cf1ee6b424953b4fdd39a2e4f0a7571c4..b6b9e480a4eab8cb7446b534b38d982044652334 100644 (file)
@@ -54,7 +54,7 @@ func init() {
 }
 
 // Active spinning runtime support.
-// runtime_canSpin returns true if spinning makes sense at the moment.
+// runtime_canSpin reports whether spinning makes sense at the moment.
 func runtime_canSpin(i int) bool
 
 // runtime_doSpin does active spinning.
index dd84e33c0f1d730648e037fa42ff752809f7fff6..ee2123f9393fc0740c2b739a59061a2e0d6d4670 100644 (file)
@@ -694,7 +694,7 @@ func (src *Source) ParseFile(path string) error {
        return nil
 }
 
-// IsStdRepo returns true if src is part of standard library.
+// IsStdRepo reports whether src is part of standard library.
 func (src *Source) IsStdRepo() (bool, error) {
        if len(src.Files) == 0 {
                return false, errors.New("no input files provided")