]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/xml: document that embedded interfaces look like non-embedded ones
authorSean Liao <sean@liao.dev>
Sun, 20 Oct 2024 09:46:03 +0000 (10:46 +0100)
committerGopher Robot <gobot@golang.org>
Mon, 21 Oct 2024 15:18:09 +0000 (15:18 +0000)
Fixes #69941

Change-Id: Icc3c88d57c14fa9ca203c693d67f144686fed8cc
Reviewed-on: https://go-review.googlesource.com/c/go/+/621076
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/encoding/xml/marshal.go

index 05b5542dfb41626b77974b902aadc584d17f7b4d..133503fa2de41c4b64a8077e9651b3facc11fc4c 100644 (file)
@@ -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