]> Cypherpunks repositories - gostls13.git/commit
encoding/xml: prevent omitempty from omitting non-nil pointers to empty values
authorAllan Simon <allan.simon@supinfo.com>
Sat, 10 Oct 2015 20:16:58 +0000 (04:16 +0800)
committerRuss Cox <rsc@golang.org>
Thu, 13 Oct 2016 00:07:09 +0000 (00:07 +0000)
commitdaa121167b6ce630aba00195f1c3872cda39a50c
treeb48b63775fc74a4767e0403f49e1667d00c979b1
parent347259cbae30f876be11fe5e71710969afa24374
encoding/xml: prevent omitempty from omitting non-nil pointers to empty values

There was an inconsistency between the (json encoding + documentation)
and the xml encoding implementation. Pointer to an empty value was
not being serialized (i.e simply ignored). Which had the effect of making
impossible to have a struct with a string field for which we wanted to
serialize the value ""

Fixes #5452

Change-Id: Id858701801158409be01e962d2cda843424bd22a
Reviewed-on: https://go-review.googlesource.com/15684
Reviewed-by: Russ Cox <rsc@golang.org>
src/encoding/xml/marshal.go
src/encoding/xml/marshal_test.go