]> Cypherpunks repositories - gostls13.git/commit
encoding/json: cleanup detection of unexported embedded fields
authorJoe Tsai <joetsai@digital-static.net>
Fri, 22 Sep 2017 22:44:09 +0000 (15:44 -0700)
committerJoe Tsai <thebrokentoaster@gmail.com>
Sat, 23 Sep 2017 00:33:34 +0000 (00:33 +0000)
commit6872a8e1c9904af5f6c23e42e01b027c8cd1c813
tree243b628cdb5d3061edc07181425dcd986b18e928
parente97209515ad8c4042f5a3ef32068200366892fc2
encoding/json: cleanup detection of unexported embedded fields

CL 60410 fixes the compiler such that reflect.StructField.PkgPath
is non-empty if and only if the field is unexported.
Given that property, we can cleanup the logic in the json encoder
to avoid parsing the field name to detect export properties.

Updates #21122

Change-Id: Ic01b9c4ca76386774846b742b0c1b9b948f53e7c
Reviewed-on: https://go-review.googlesource.com/65550
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/encoding/json/encode.go