summaryrefslogtreecommitdiff
path: root/src/pkg/json
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-11-20 11:45:05 -0800
committerRuss Cox <rsc@golang.org>2009-11-20 11:45:05 -0800
commitc861f30835090bbd6b9b35a80667f26952843767 (patch)
tree645bd57ef3c9326ec02e646a751b9075d12a79e7 /src/pkg/json
parent7089e97992d5d6be520dfea787200061992526c8 (diff)
downloadgolang-c861f30835090bbd6b9b35a80667f26952843767.tar.gz
gofmt -r 'α[β:len(α)] -> α[β:]' -w src/cmd src/pkg
R=r, gri CC=golang-dev http://codereview.appspot.com/156115
Diffstat (limited to 'src/pkg/json')
-rw-r--r--src/pkg/json/generic.go2
-rw-r--r--src/pkg/json/parse.go6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/pkg/json/generic.go b/src/pkg/json/generic.go
index fb97edc19..eed8f9daa 100644
--- a/src/pkg/json/generic.go
+++ b/src/pkg/json/generic.go
@@ -172,7 +172,7 @@ func Walk(j Json, path string) Json {
var elem string;
if i := strings.Index(path, "/"); i >= 0 {
elem = path[0:i];
- path = path[i+1 : len(path)];
+ path = path[i+1:];
} else {
elem = path;
path = "";
diff --git a/src/pkg/json/parse.go b/src/pkg/json/parse.go
index d96abd961..008637593 100644
--- a/src/pkg/json/parse.go
+++ b/src/pkg/json/parse.go
@@ -101,7 +101,7 @@ func Unquote(s string) (t string, ok bool) {
return
}
r += 4;
- w += utf8.EncodeRune(rune, b[w:len(b)]);
+ w += utf8.EncodeRune(rune, b[w:]);
}
// Control characters are invalid, but we've seen raw \n.
case s[r] < ' ' && s[r] != '\n':
@@ -119,9 +119,9 @@ func Unquote(s string) (t string, ok bool) {
w++;
// Coerce to well-formed UTF-8.
default:
- rune, size := utf8.DecodeRuneInString(s[r:len(s)]);
+ rune, size := utf8.DecodeRuneInString(s[r:]);
r += size;
- w += utf8.EncodeRune(rune, b[w:len(b)]);
+ w += utf8.EncodeRune(rune, b[w:]);
}
}
return string(b[0:w]), true;