diff options
author | Alexander Greim <alexxx@iltempo.de> | 2020-03-29 17:10:44 +0200 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2020-03-30 03:39:49 +0000 |
commit | 0b7c202e98949b530f7f4011efd454164356ba69 (patch) | |
tree | 444345db690ed27cc67275511ab984a764df9f50 /src/strings | |
parent | 7bfac4c3ddde3dd906b344f141a9d09a5f855c77 (diff) | |
download | go-0b7c202e98949b530f7f4011efd454164356ba69.tar.gz go-0b7c202e98949b530f7f4011efd454164356ba69.zip |
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 <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>
Diffstat (limited to 'src/strings')
-rw-r--r-- | src/strings/strings.go | 6 |
1 files changed, 3 insertions, 3 deletions
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 } |