diff options
| author | Josh Bleecher Snyder <josharian@gmail.com> | 2015-02-17 15:44:42 -0800 |
|---|---|---|
| committer | Josh Bleecher Snyder <josharian@gmail.com> | 2015-03-18 15:14:06 +0000 |
| commit | 2adc4e892704bb99f2d16c0c09777987cb6bed35 (patch) | |
| tree | 4e61f69a0e448b82df4e1c7c8c621f397298e7b9 /src/cmd | |
| parent | fcb895feef1c9214f9cb633b5a0fa4dc8f46af9e (diff) | |
| download | go-2adc4e892704bb99f2d16c0c09777987cb6bed35.tar.xz | |
all: use "reports whether" in place of "returns true if(f)"
Comment changes only.
Change-Id: I56848814564c4aa0988b451df18bebdfc88d6d94
Reviewed-on: https://go-review.googlesource.com/7721
Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/cmd')
| -rw-r--r-- | src/cmd/cgo/gcc.go | 2 | ||||
| -rw-r--r-- | src/cmd/cgo/main.go | 2 | ||||
| -rw-r--r-- | src/cmd/cgo/util.go | 2 | ||||
| -rw-r--r-- | src/cmd/fix/fix.go | 20 | ||||
| -rw-r--r-- | src/cmd/go/pkg.go | 2 | ||||
| -rw-r--r-- | src/cmd/gofmt/rewrite.go | 2 |
6 files changed, 15 insertions, 15 deletions
diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index 4bc4d794c8..3ec753f55e 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -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 } diff --git a/src/cmd/cgo/main.go b/src/cmd/cgo/main.go index 013fed3746..41abb2c672 100644 --- a/src/cmd/cgo/main.go +++ b/src/cmd/cgo/main.go @@ -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" } diff --git a/src/cmd/cgo/util.go b/src/cmd/cgo/util.go index 4e7800d127..3adb8e8783 100644 --- a/src/cmd/cgo/util.go +++ b/src/cmd/cgo/util.go @@ -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') { diff --git a/src/cmd/fix/fix.go b/src/cmd/fix/fix.go index a07bbac790..160336cdbd 100644 --- a/src/cmd/fix/fix.go +++ b/src/cmd/fix/fix.go @@ -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{}) { diff --git a/src/cmd/go/pkg.go b/src/cmd/go/pkg.go index 9b2e44c61b..6c157932fb 100644 --- a/src/cmd/go/pkg.go +++ b/src/cmd/go/pkg.go @@ -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 { diff --git a/src/cmd/gofmt/rewrite.go b/src/cmd/gofmt/rewrite.go index d267cfcc1d..069f96622c 100644 --- a/src/cmd/gofmt/rewrite.go +++ b/src/cmd/gofmt/rewrite.go @@ -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 { |
