aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/strings/strings.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-11-06 14:24:38 -0800
committerRobert Griesemer <gri@golang.org>2009-11-06 14:24:38 -0800
commit368f8cbc75c93451fc81a7eacc928e4080d8ed67 (patch)
tree0a5ca144b8eb407f99639ec5de1ee2f0df4e747c /src/pkg/strings/strings.go
parent8c40900fc28a7dda33a491902c5545b9abb37f58 (diff)
downloadgo-368f8cbc75c93451fc81a7eacc928e4080d8ed67.tar.xz
- fine-tuning of one-line func heuristic (nodes.go)
- enabled for function declarations (not just function literals) - applied gofmt -w $GOROOT/src (look for instance at src/pkg/debug/elf/elf.go) R=r, rsc CC=go-dev http://go/go-review/1026006
Diffstat (limited to 'src/pkg/strings/strings.go')
-rw-r--r--src/pkg/strings/strings.go16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/pkg/strings/strings.go b/src/pkg/strings/strings.go
index 5f3dcfcdc4..4169f62114 100644
--- a/src/pkg/strings/strings.go
+++ b/src/pkg/strings/strings.go
@@ -107,9 +107,7 @@ func genSplit(s, sep string, sepSave, n int) []string {
// Split splits the string s around each instance of sep, returning an array of substrings of s.
// If sep is empty, Split splits s after each UTF-8 sequence.
// If n > 0, split Splits s into at most n substrings; the last substring will be the unsplit remainder.
-func Split(s, sep string, n int) []string {
- return genSplit(s, sep, 0, n);
-}
+func Split(s, sep string, n int) []string { return genSplit(s, sep, 0, n) }
// SplitAfter splits the string s after each instance of sep, returning an array of substrings of s.
// If sep is empty, SplitAfter splits s after each UTF-8 sequence.
@@ -191,19 +189,13 @@ func Map(mapping func(rune int) int, s string) string {
}
// ToUpper returns a copy of the string s with all Unicode letters mapped to their upper case.
-func ToUpper(s string) string {
- return Map(unicode.ToUpper, s);
-}
+func ToUpper(s string) string { return Map(unicode.ToUpper, s) }
// ToUpper returns a copy of the string s with all Unicode letters mapped to their lower case.
-func ToLower(s string) string {
- return Map(unicode.ToLower, s);
-}
+func ToLower(s string) string { return Map(unicode.ToLower, s) }
// ToTitle returns a copy of the string s with all Unicode letters mapped to their title case.
-func ToTitle(s string) string {
- return Map(unicode.ToTitle, s);
-}
+func ToTitle(s string) string { return Map(unicode.ToTitle, s) }
// Trim returns a slice of the string s, with all leading and trailing white space
// removed, as defined by Unicode.