]> Cypherpunks repositories - gostls13.git/commit
encoding/xml: add Marshal doc about name conflicts
authorLeigh McCulloch <leighmcc@gmail.com>
Tue, 7 Nov 2017 05:33:35 +0000 (05:33 +0000)
committerIan Lance Taylor <iant@golang.org>
Wed, 8 Nov 2017 18:05:39 +0000 (18:05 +0000)
commit65a864a628cb9ab767fb973d82ed979d6046f4f2
treee5ca756a77fe256d4db58149932a2ce4a8436b0f
parent1125fae989a3016d509c23fee15793b231e5e8e1
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>
src/encoding/xml/marshal.go