aboutsummaryrefslogtreecommitdiff
path: root/src/bytes
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2023-08-31 19:15:19 -0700
committerGopher Robot <gobot@golang.org>2023-09-01 04:29:02 +0000
commit62fb281cf72d4b7fa0a29500911a4af3a244f90f (patch)
tree0a4fc1325e04cfb0e266188fdd7037edda9e03f2 /src/bytes
parent7a4787d12a23f75c670f618a049eaaac69eb4016 (diff)
downloadgo-62fb281cf72d4b7fa0a29500911a4af3a244f90f.tar.gz
go-62fb281cf72d4b7fa0a29500911a4af3a244f90f.zip
bytes, strings: use "reports whether" in HasPrefix and HasSuffix
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>
Diffstat (limited to 'src/bytes')
-rw-r--r--src/bytes/bytes.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bytes/bytes.go b/src/bytes/bytes.go
index 7ecf3b59f6..9ee66cae4e 100644
--- a/src/bytes/bytes.go
+++ b/src/bytes/bytes.go
@@ -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)
}