From 9d2cb8442337201c74e4f4789e6a8ccfc18eb337 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Fri, 23 Jan 2009 15:56:04 -0800 Subject: 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 --- src/lib/json/struct.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/json/struct.go') 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; -- cgit v1.2.3