From 9ac8940d2974f695aaf3e36476f561de4837f5e4 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 23 Jul 2013 10:37:43 +1000 Subject: [PATCH] all: be more idiomatic when documenting boolean return values. Phrases like "returns whether or not the image is opaque" could be describing what the function does (it always returns, regardless of the opacity) or what it returns (a boolean indicating the opacity). Even when the "or not" is missing, the phrasing is bizarre. Go with "reports whether", which is still clunky but at least makes it clear we're talking about the return value. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/11458046 --- cmd/cover/html.go | 2 +- godoc/util/util.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/cover/html.go b/cmd/cover/html.go index f44c7eb9..113009b9 100644 --- a/cmd/cover/html.go +++ b/cmd/cover/html.go @@ -275,7 +275,7 @@ func htmlGen(w io.Writer, src []byte, tokens []Token) error { } // startBrowser tries to open the URL in a browser -// and returns whether it succeed. +// and reports whether it succeeds. func startBrowser(url string) bool { // try to start the browser var args []string diff --git a/godoc/util/util.go b/godoc/util/util.go index 8e37defa..1371bcd1 100644 --- a/godoc/util/util.go +++ b/godoc/util/util.go @@ -35,7 +35,7 @@ func (v *RWValue) Get() (interface{}, time.Time) { return v.value, v.timestamp } -// IsText returns whether a significant prefix of s looks like correct UTF-8; +// IsText reports whether a significant prefix of s looks like correct UTF-8; // that is, if it is likely that s is human-readable text. func IsText(s []byte) bool { const max = 1024 // at least utf8.UTFMax @@ -61,7 +61,7 @@ var textExt = map[string]bool{ ".js": false, // must be served raw } -// IsTextFile returns whether the file has a known extension indicating +// IsTextFile reports whether the file has a known extension indicating // a text file, or if a significant chunk of the specified file looks like // correct UTF-8; that is, if it is likely that the file contains human- // readable text.