From 5f0170f9a529c7113ac12f1270e00e5bdc444803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Bohusl=C3=A1vek?= Date: Thu, 18 Aug 2022 11:02:38 +0200 Subject: [PATCH] bytes, strings: s/after/before/ in CutSuffix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This follows on CL 407176 which added this function (in both packages). This CL makes it consistent with the Cut function, which uses “before” and “after” in return variable names. Change-Id: Id4345d2fe0f50bf301a880803e87bf356986b518 Reviewed-on: https://go-review.googlesource.com/c/go/+/424922 Run-TryBot: Robert Griesemer Reviewed-by: Robert Griesemer TryBot-Result: Gopher Robot Auto-Submit: Robert Griesemer Reviewed-by: Ian Lance Taylor --- src/bytes/bytes.go | 2 +- src/strings/strings.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bytes/bytes.go b/src/bytes/bytes.go index c0cd704180b..5cf5b477ebd 100644 --- a/src/bytes/bytes.go +++ b/src/bytes/bytes.go @@ -1329,7 +1329,7 @@ func CutPrefix(s, prefix []byte) (after []byte, found bool) { // If suffix is the empty byte slice, CutSuffix returns s, true. // // CutSuffix returns slices of the original slice s, not copies. -func CutSuffix(s, suffix []byte) (after []byte, found bool) { +func CutSuffix(s, suffix []byte) (before []byte, found bool) { if !HasSuffix(s, suffix) { return s, false } diff --git a/src/strings/strings.go b/src/strings/strings.go index 7921a20e8ab..1e8de2bc34c 100644 --- a/src/strings/strings.go +++ b/src/strings/strings.go @@ -1223,7 +1223,7 @@ func CutPrefix(s, prefix string) (after string, found bool) { // and reports whether it found the suffix. // If s doesn't end with suffix, CutSuffix returns s, false. // If suffix is the empty string, CutSuffix returns s, true. -func CutSuffix(s, suffix string) (after string, found bool) { +func CutSuffix(s, suffix string) (before string, found bool) { if !HasSuffix(s, suffix) { return s, false }