From: Sean Liao Date: Sun, 20 Oct 2024 09:46:03 +0000 (+0100) Subject: encoding/xml: document that embedded interfaces look like non-embedded ones X-Git-Tag: go1.24rc1~674 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e3d372aea86df4b3a848c0c454b364febca825d6;p=gostls13.git encoding/xml: document that embedded interfaces look like non-embedded ones Fixes #69941 Change-Id: Icc3c88d57c14fa9ca203c693d67f144686fed8cc Reviewed-on: https://go-review.googlesource.com/c/go/+/621076 LUCI-TryBot-Result: Go LUCI Auto-Submit: Ian Lance Taylor Reviewed-by: Ian Lance Taylor Reviewed-by: Dmitri Shuralyov --- diff --git a/src/encoding/xml/marshal.go b/src/encoding/xml/marshal.go index 05b5542dfb..133503fa2d 100644 --- a/src/encoding/xml/marshal.go +++ b/src/encoding/xml/marshal.go @@ -62,6 +62,8 @@ const ( // string of length zero. // - an anonymous struct field is handled as if the fields of its // value were part of the outer struct. +// - an anonymous struct field of interface type is treated the same as having +// that type as its name, rather than being anonymous. // - a field implementing [Marshaler] is written by calling its MarshalXML // method. // - a field implementing [encoding.TextMarshaler] is written by encoding the