]> Cypherpunks repositories - gostls13.git/commit
encoding/xml: unmarshal allow empty, non-string values
authorSarah Adams <shadams@google.com>
Mon, 20 Mar 2017 23:11:46 +0000 (16:11 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 22 Mar 2017 23:33:36 +0000 (23:33 +0000)
commit0a0186fb7832928c9b5b1966854a8abc31678ea8
treefe23a6bf8f67191dc3cb01e93cc2fc9e54fc3307
parent1295b745d13fe1402d5b645c9c20cc3adf85d563
encoding/xml: unmarshal allow empty, non-string values

When unmarshaling, if an element is empty, eg. '<tag></tag>', and
destination type is int, uint, float or bool, do not attempt to parse
value (""). Set to its zero value instead.

Fixes #13417

Change-Id: I2d79f6d8f39192bb277b1a9129727d5abbb2dd1f
Reviewed-on: https://go-review.googlesource.com/38386
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/encoding/xml/read.go
src/encoding/xml/read_test.go