summaryrefslogtreecommitdiff
path: root/src/pkg/json/struct.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-08-05 15:56:44 -0700
committerRobert Griesemer <gri@golang.org>2009-08-05 15:56:44 -0700
commit8b5f87a023f0ac728c619e34d9295a1e664f197c (patch)
treeadc5c7fd097b41c24adee9429bb45cd37883a9ff /src/pkg/json/struct.go
parentd783faf961422b4832dcda901fae99402af4a8a4 (diff)
downloadgolang-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.go2
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++ {