Is there a downside in using `xml.Encode` instead of `xml.EncodeElement` 
when implementing the `xml.Marshaler` interface?

I see in the documentation:

    Using start as the element tag is not required, but doing so will 
enable Unmarshal to match the XML elements to the correct struct field.

But am not sure if not leveraging "will enable..." does have a concrete 
downside?

I marshal a type `Amount` to `<amount currency="USD">42</amount>` via 
`xml.Encoder.Encode`: https://play.golang.org/p/64FC-j0FyA . 

If I however use `xml.Encoder.EncodeElement` I get: `<Amount 
currency="USD">42</Amount>` (uppercased).




-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to