From 62fb281cf72d4b7fa0a29500911a4af3a244f90f Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Thu, 31 Aug 2023 19:15:19 -0700 Subject: 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 Reviewed-by: Ian Lance Taylor Auto-Submit: Matthew Dempsky LUCI-TryBot-Result: Go LUCI --- src/bytes/bytes.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bytes/bytes.go') 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) } -- cgit v1.3-5-g9baa