aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/strings/strings.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-02-25 16:01:29 -0800
committerRuss Cox <rsc@golang.org>2010-02-25 16:01:29 -0800
commit9750adbbadad547ef71cc5f0dbd6b80af7edef09 (patch)
treec6ab3b4ef4175de81b8c93de57907354a8de1418 /src/pkg/strings/strings.go
parentdfaa6eaa76bb1d440a2e7f93fa2ee6da622f9d0d (diff)
downloadgo-9750adbbadad547ef71cc5f0dbd6b80af7edef09.tar.xz
strings: delete Runes, Bytes
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench delete unused imports R=r CC=golang-dev https://golang.org/cl/224062
Diffstat (limited to 'src/pkg/strings/strings.go')
-rw-r--r--src/pkg/strings/strings.go20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/pkg/strings/strings.go b/src/pkg/strings/strings.go
index eb2b7e09c6..80e8207951 100644
--- a/src/pkg/strings/strings.go
+++ b/src/pkg/strings/strings.go
@@ -302,23 +302,3 @@ func TrimSpace(s string) string {
}
return s[start:end]
}
-
-// Bytes returns a new slice containing the bytes in s.
-func Bytes(s string) []byte {
- b := make([]byte, len(s))
- for i := 0; i < len(s); i++ {
- b[i] = s[i]
- }
- return b
-}
-
-// Runes returns a slice of runes (Unicode code points) equivalent to the string s.
-func Runes(s string) []int {
- t := make([]int, utf8.RuneCountInString(s))
- i := 0
- for _, r := range s {
- t[i] = r
- i++
- }
- return t
-}