mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
bytes, strings: s/after/before/ in CutSuffix
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 <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
2e06019dcd
commit
5f0170f9a5
2 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue