summaryrefslogtreecommitdiff
path: root/src/pkg/strconv
diff options
context:
space:
mode:
authorBrad Fitzpatrick <brad@danga.com>2010-11-01 14:32:48 -0700
committerBrad Fitzpatrick <brad@danga.com>2010-11-01 14:32:48 -0700
commit1a991bdd4d1c273bbd24be9678219f91664a233c (patch)
tree7e4c7b4d89feb40c311007e17ad801bdca923f03 /src/pkg/strconv
parent49219f33aa989cacdffe1d207fa04b34192ca985 (diff)
downloadgo-1a991bdd4d1c273bbd24be9678219f91664a233c.tar.gz
strings: Contains
Tiny helper to avoid strings.Index(s, sub) != -1 R=rsc, r2, r CC=golang-dev http://codereview.appspot.com/2265044 Committer: Rob Pike <r@golang.org>
Diffstat (limited to 'src/pkg/strconv')
-rw-r--r--src/pkg/strconv/quote.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/strconv/quote.go b/src/pkg/strconv/quote.go
index ca62296d6..ed5889723 100644
--- a/src/pkg/strconv/quote.go
+++ b/src/pkg/strconv/quote.go
@@ -234,7 +234,7 @@ func Unquote(s string) (t string, err os.Error) {
s = s[1 : n-1]
if quote == '`' {
- if strings.Index(s, "`") >= 0 {
+ if strings.Contains(s, "`") {
return "", os.EINVAL
}
return s, nil