summaryrefslogtreecommitdiff
path: root/src/lib/json/parse.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-01-06 15:19:02 -0800
committerRuss Cox <rsc@golang.org>2009-01-06 15:19:02 -0800
commite684aa575c07e0c3b15d959ff4b06d9d8787597a (patch)
treef3f98baba1fdd5e0138a4875884aa85111308b3f /src/lib/json/parse.go
parent2e8a2665111620da74f35212abc1414c1bab4bad (diff)
downloadgolang-e684aa575c07e0c3b15d959ff4b06d9d8787597a.tar.gz
new new & make
R=r OCL=22166 CL=22166
Diffstat (limited to 'src/lib/json/parse.go')
-rw-r--r--src/lib/json/parse.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/json/parse.go b/src/lib/json/parse.go
index f38bb59a6..cec2a2961 100644
--- a/src/lib/json/parse.go
+++ b/src/lib/json/parse.go
@@ -48,7 +48,7 @@ export func Unquote(s string) (t string, ok bool) {
if len(s) < 2 || s[0] != '"' || s[len(s)-1] != '"' {
return
}
- b := new([]byte, len(s));
+ b := make([]byte, len(s));
w := 0;
for r := 1; r < len(s)-1; {
switch {
@@ -118,9 +118,9 @@ export func Unquote(s string) (t string, ok bool) {
}
export func Quote(s string) string {
- chr := new([]byte, utf8.UTFMax);
+ chr := make([]byte, utf8.UTFMax);
chr0 := chr[0:1];
- b := new(*io.ByteBuffer);
+ b := new(io.ByteBuffer);
chr[0] = '"';
b.Write(chr0);
for i := 0; i < len(s); i++ {
@@ -387,7 +387,7 @@ Switch:
}
export func Parse(s string, build Builder) (ok bool, errindx int, errtok string) {
- lex := new(*Lexer);
+ lex := new(Lexer);
lex.s = s;
lex.Next();
if ParseValue(lex, build) {