]> Cypherpunks.ru repositories - gostls13.git/commitdiff
bytes, strings: use "reports whether" in HasPrefix and HasSuffix
authorMatthew Dempsky <mdempsky@google.com>
Fri, 1 Sep 2023 02:15:19 +0000 (19:15 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 1 Sep 2023 04:29:02 +0000 (04:29 +0000)
Update the doc comments to use the more idiomatic and common phrase
"reports whether" instead of "tests whether".

Change-Id: I2b7f8cce2d192f66e296ebaa9b37f37e8276b4ae
Reviewed-on: https://go-review.googlesource.com/c/go/+/524898
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/bytes/bytes.go
src/strings/strings.go

index 7ecf3b59f6ef1dddae69d9bcb09920b02735256f..9ee66cae4e11f1c6e43af0b3989b754f0f39ff92 100644 (file)
@@ -552,12 +552,12 @@ func Join(s [][]byte, sep []byte) []byte {
        return b
 }
 
-// HasPrefix tests whether the byte slice s begins with prefix.
+// HasPrefix reports whether the byte slice s begins with prefix.
 func HasPrefix(s, prefix []byte) bool {
        return len(s) >= len(prefix) && Equal(s[0:len(prefix)], prefix)
 }
 
-// HasSuffix tests whether the byte slice s ends with suffix.
+// HasSuffix reports whether the byte slice s ends with suffix.
 func HasSuffix(s, suffix []byte) bool {
        return len(s) >= len(suffix) && Equal(s[len(s)-len(suffix):], suffix)
 }
index 301cd8667eda278c069388f0318f1180ca201dd9..ece7237c4431ab2960189f3edaba7e291876826b 100644 (file)
@@ -458,12 +458,12 @@ func Join(elems []string, sep string) string {
        return b.String()
 }
 
-// HasPrefix tests whether the string s begins with prefix.
+// HasPrefix reports whether the string s begins with prefix.
 func HasPrefix(s, prefix string) bool {
        return len(s) >= len(prefix) && s[0:len(prefix)] == prefix
 }
 
-// HasSuffix tests whether the string s ends with suffix.
+// HasSuffix reports whether the string s ends with suffix.
 func HasSuffix(s, suffix string) bool {
        return len(s) >= len(suffix) && s[len(s)-len(suffix):] == suffix
 }