summaryrefslogtreecommitdiff
path: root/src/pkg/strconv/quote.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/strconv/quote.go')
-rw-r--r--src/pkg/strconv/quote.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/pkg/strconv/quote.go b/src/pkg/strconv/quote.go
index 53774ee6f..ed5889723 100644
--- a/src/pkg/strconv/quote.go
+++ b/src/pkg/strconv/quote.go
@@ -100,11 +100,12 @@ func unhex(b byte) (v int, ok bool) {
// UnquoteChar decodes the first character or byte in the escaped string
// or character literal represented by the string s.
// It returns four values:
-// 1) value, the decoded Unicode code point or byte value;
-// 2) multibyte, a boolean indicating whether the decoded character
-// requires a multibyte UTF-8 representation;
-// 3) tail, the remainder of the string after the character; and
-// 4) an error that will be nil if the character is syntactically valid.
+//
+// 1) value, the decoded Unicode code point or byte value;
+// 2) multibyte, a boolean indicating whether the decoded character requires a multibyte UTF-8 representation;
+// 3) tail, the remainder of the string after the character; and
+// 4) an error that will be nil if the character is syntactically valid.
+//
// The second argument, quote, specifies the type of literal being parsed
// and therefore which escaped quote character is permitted.
// If set to a single quote, it permits the sequence \' and disallows unescaped '.
@@ -233,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