summaryrefslogtreecommitdiff
path: root/src/lib/json
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2009-01-23 15:56:04 -0800
committerRob Pike <r@golang.org>2009-01-23 15:56:04 -0800
commit9d2cb8442337201c74e4f4789e6a8ccfc18eb337 (patch)
tree70b8e9ba1512beca6661fa704869d6fcbe069b4c /src/lib/json
parent570c88d37bc1dac66a9aac157295fb156bb3983b (diff)
downloadgolang-9d2cb8442337201c74e4f4789e6a8ccfc18eb337.tar.gz
remove the "open" concept from reflect and go with slices and arrays.
the two still share an interface and Kind; that's probably ok but might be worth revisiting. R=rsc DELTA=74 (1 added, 8 deleted, 65 changed) OCL=23416 CL=23418
Diffstat (limited to 'src/lib/json')
-rw-r--r--src/lib/json/struct.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/json/struct.go b/src/lib/json/struct.go
index 0d0c1476e..f37ee461e 100644
--- a/src/lib/json/struct.go
+++ b/src/lib/json/struct.go
@@ -122,7 +122,7 @@ func (b *_StructBuilder) Array() {
pv := v.(reflect.PtrValue);
psubtype := pv.Type().(reflect.PtrType).Sub();
if pv.Get() == nil && psubtype.Kind() == reflect.ArrayKind {
- av := reflect.NewOpenArrayValue(psubtype, 0, 8);
+ av := reflect.NewSliceValue(psubtype, 0, 8);
pv.SetSub(av);
}
}
@@ -148,7 +148,7 @@ func (b *_StructBuilder) Elem(i int) Builder {
for n <= i {
n *= 2
}
- av1 := reflect.NewOpenArrayValue(av.Type(), av.Len(), n);
+ av1 := reflect.NewSliceValue(av.Type(), av.Len(), n);
av1.CopyFrom(av, av.Len());
pv.SetSub(av1);
av = av1;