From: Alexander Greim Date: Sun, 29 Mar 2020 15:10:44 +0000 (+0200) Subject: strings: make variable/type association consistent in function signatures X-Git-Tag: go1.15beta1~719 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0b7c202e98949b530f7f4011efd454164356ba69;p=gostls13.git strings: make variable/type association consistent in function signatures 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 TryBot-Result: Gobot Gobot Reviewed-by: Emmanuel Odeke Reviewed-by: Ian Lance Taylor --- diff --git a/src/strings/strings.go b/src/strings/strings.go index 6d78b9ef16..314e2276d4 100644 --- a/src/strings/strings.go +++ b/src/strings/strings.go @@ -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 }