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/fix | |
| 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/fix')
| -rw-r--r-- | src/cmd/fix/fix.go | 20 |
1 files changed, 10 insertions, 10 deletions
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{}) { |
