]> Cypherpunks.ru repositories - gostls13.git/commitdiff
strings: make variable/type association consistent in function signatures
authorAlexander Greim <alexxx@iltempo.de>
Sun, 29 Mar 2020 15:10:44 +0000 (17:10 +0200)
committerIan Lance Taylor <iant@golang.org>
Mon, 30 Mar 2020 03:39:49 +0000 (03:39 +0000)
The type annotation of some trim functions are inconsistent with all
other function signatures of the strings package.

Example:
func TrimRight(s string, cutset string) string

To be:
func TrimRight(s, cutset string) string

Change-Id: I456a33287bfb4ad6a7962e30a6424f209ac320c1
Reviewed-on: https://go-review.googlesource.com/c/go/+/226339
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/strings/strings.go

index 6d78b9ef16d9e08085bc9455d00bd40f775947ac..314e2276d41dc9ae19f3aaff042e6a8a30e653ad 100644 (file)
@@ -828,7 +828,7 @@ func makeCutsetFunc(cutset string) func(rune) bool {
 
 // Trim returns a slice of the string s with all leading and
 // trailing Unicode code points contained in cutset removed.
-func Trim(s string, cutset string) string {
+func Trim(s, cutset string) string {
        if s == "" || cutset == "" {
                return s
        }
@@ -839,7 +839,7 @@ func Trim(s string, cutset string) string {
 // Unicode code points contained in cutset removed.
 //
 // To remove a prefix, use TrimPrefix instead.
-func TrimLeft(s string, cutset string) string {
+func TrimLeft(s, cutset string) string {
        if s == "" || cutset == "" {
                return s
        }
@@ -850,7 +850,7 @@ func TrimLeft(s string, cutset string) string {
 // Unicode code points contained in cutset removed.
 //
 // To remove a suffix, use TrimSuffix instead.
-func TrimRight(s string, cutset string) string {
+func TrimRight(s, cutset string) string {
        if s == "" || cutset == "" {
                return s
        }