go/src/encoding/xml
Leigh McCulloch 65a864a628 encoding/xml: add Marshal doc about name conflicts
The docs for xml.Marshal state that the XML elements name is derived
from one of five locations in a specific order of precedence, but does
not mention that if the field is a struct type and has its name defined
in a tag and in the types XMLName field that an error will occur. This
is documented in the structFieldInfo function but not in the function
documentation, and the existing docs in Marshal are misleading without
this behavior being discussed.

Fixes #18564

Change-Id: I29042f124a534bd1bc993f1baeddaa0af2e72fed
Reviewed-on: https://go-review.googlesource.com/76321
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-08 18:05:39 +00:00
..
atom_test.go encoding/xml: improve package based on the suggestions from metalinter 2017-08-24 00:55:59 +00:00
example_test.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
marshal.go encoding/xml: add Marshal doc about name conflicts 2017-11-08 18:05:39 +00:00
marshal_test.go encoding/xml: improve package based on the suggestions from metalinter 2017-08-24 00:55:59 +00:00
read.go encoding/xml: ignore whitespace in values and attrs 2017-11-01 20:39:57 +00:00
read_test.go all: change github.com issue links to golang.org 2017-11-04 04:13:41 +00:00
typeinfo.go all: revert "all: prefer strings.IndexByte over strings.Index" 2017-10-05 23:19:10 +00:00
xml.go encoding/xml: don't panic when custom Unmarshaler sees StartElement 2017-10-30 18:52:19 +00:00
xml_test.go encoding/xml: don't panic when custom Unmarshaler sees StartElement 2017-10-30 18:52:19 +00:00