From 8fd56bf8c49b7ffcae4f4fbebdc3bed9c7acb9ea Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 6 Oct 2014 15:48:17 -0400 Subject: [PATCH] encoding/json: document that embedded interfaces look like non-embedded ones Fixes #8386. LGTM=r R=golang-codereviews, r CC=golang-codereviews, iant https://golang.org/cl/149570043 --- src/encoding/json/encode.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/encoding/json/encode.go b/src/encoding/json/encode.go index b63538c922..9b7b9d5fd1 100644 --- a/src/encoding/json/encode.go +++ b/src/encoding/json/encode.go @@ -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 -- 2.50.0