diff options
author | Robert Griesemer <gri@golang.org> | 2009-08-05 15:56:44 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2009-08-05 15:56:44 -0700 |
commit | 8b5f87a023f0ac728c619e34d9295a1e664f197c (patch) | |
tree | adc5c7fd097b41c24adee9429bb45cd37883a9ff /src/pkg/json/struct.go | |
parent | d783faf961422b4832dcda901fae99402af4a8a4 (diff) | |
download | golang-8b5f87a023f0ac728c619e34d9295a1e664f197c.tar.gz |
- FieldByName lookup through anonymous fields
- FieldByIndex
- changed StructField.Index type from int -> []int
- adjustments to reflect clients
R=rsc,r
DELTA=336 (263 added, 47 deleted, 26 changed)
OCL=32731
CL=32802
Diffstat (limited to 'src/pkg/json/struct.go')
-rw-r--r-- | src/pkg/json/struct.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/json/struct.go b/src/pkg/json/struct.go index ee23d1e9d..b6cebe12d 100644 --- a/src/pkg/json/struct.go +++ b/src/pkg/json/struct.go @@ -185,7 +185,7 @@ func (b *_StructBuilder) Key(k string) Builder { if v, ok := reflect.Indirect(b.val).(*reflect.StructValue); ok { t := v.Type().(*reflect.StructType); if field, ok := t.FieldByName(k); ok { - return &_StructBuilder{ v.Field(field.Index) } + return &_StructBuilder{ v.FieldByIndex(field.Index) } } // Again, case-insensitive. for i := 0; i < t.NumField(); i++ { |