Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding/xml: unmarshal fails for numeric types if field empty #5857

Closed
eaigner opened this issue Jul 10, 2013 · 11 comments
Closed

encoding/xml: unmarshal fails for numeric types if field empty #5857

eaigner opened this issue Jul 10, 2013 · 11 comments

Comments

@eaigner
Copy link
Contributor

eaigner commented Jul 10, 2013

When a XML tag contains an empty string, unmarshalling fails with

    strconv.ParseInt: parsing "": invalid syntax

A more sensible default would be to just omit this field if the value cannot be parsed
(is the zero value).
@robpike
Copy link
Contributor

robpike commented Jul 26, 2013

Comment 1:

Not clear what the behavior should be in this case, but it's worth being clear either
way.

Labels changed: added priority-later, removed priority-triage.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 2:

Labels changed: added go1.2maybe.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 3:

Labels changed: added feature.

@eaigner
Copy link
Contributor Author

eaigner commented Aug 19, 2013

Comment 4:

The origin for this issue would be XML like this:
    <a>
      <b nil="true">
    </a>
and
    <a>
      <b type="integer">1
    </a>

@robpike
Copy link
Contributor

robpike commented Aug 30, 2013

Comment 5:

Not for 1.2.

Labels changed: removed go1.2maybe.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 6:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 7:

Labels changed: removed feature.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 8:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 9:

Labels changed: added repo-main.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@ivashyst
Copy link
Contributor

This has been fixed by CL 38386.

@bradfitz
Copy link
Contributor

@ivashyst, thanks.

@golang golang locked and limited conversation to collaborators Dec 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants