]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/json: document that embedded interfaces look like non-embedded ones
authorRuss Cox <rsc@golang.org>
Mon, 6 Oct 2014 19:48:17 +0000 (15:48 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 6 Oct 2014 19:48:17 +0000 (15:48 -0400)
Fixes #8386.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews, iant
https://golang.org/cl/149570043

src/encoding/json/encode.go

index b63538c92254f64cc23c87be589627f7aa5161e2..9b7b9d5fd18b860c8a938c7556703f3620a1eb45 100644 (file)
@@ -93,6 +93,8 @@ import (
 // as described in the next paragraph.
 // An anonymous struct field with a name given in its JSON tag is treated as
 // having that name, rather than being anonymous.
+// An anonymous struct field of interface type is treated the same as having
+// that type as its name, rather than being anonymous.
 //
 // The Go visibility rules for struct fields are amended for JSON when
 // deciding which field to marshal or unmarshal. If there are