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 not parsing bool, int64 properly #574

Closed
gopherbot opened this Issue Jan 28, 2010 · 6 comments

Comments

Projects
None yet
4 participants
@gopherbot
Copy link

gopherbot commented Jan 28, 2010

by jackbox55:

What steps will reproduce the problem?
1. Attempt to Unmarshal a bool or an int64

What is the expected output? What do you see instead?

xml -> 28462915   -> int64 field   WORKS        (fills with 28462815)
xml -> 8322638558 -> int64 field   DOESN'T WORK (fills with 0)
xml -> false      -> bool  field   DOESN'T WORK (always true)

What is your $GOOS?  $GOARCH?
linux, 386

Which revision are you using?  (hg identify)
4714:52b6d624f245
@gopherbot

This comment has been minimized.

Copy link
Author

gopherbot commented Jan 28, 2010

Comment 1 by jackbox55:

Here's a small test case. Somewhat inconsistent with what I said previously, it seems
that even regular 32 bit sized integers are not being parsed correctly. Strings work
fine.

Attachments:

  1. xml_unmarshal.go (642 bytes)
@hoisie

This comment has been minimized.

Copy link
Contributor

hoisie commented Jan 28, 2010

Comment 2:

I've come across this too. One temporary workaround is to define your data types as
strings and do the conversion to bool/int manually. But this could get annoying after
a while.
@rsc

This comment has been minimized.

Copy link
Contributor

rsc commented Jan 29, 2010

Comment 3:

Status changed to Accepted.

@robpike

This comment has been minimized.

Copy link
Contributor

robpike commented Jan 29, 2010

Comment 4:

amazing

Owner changed to r...@golang.org.

@robpike

This comment has been minimized.

Copy link
Contributor

robpike commented Jan 29, 2010

Comment 5:

Status changed to Started.

@robpike

This comment has been minimized.

Copy link
Contributor

robpike commented Feb 2, 2010

Comment 6:

This issue was closed by revision 5db5f68.

Status changed to Fixed.

Merged into issue #-.

@gopherbot gopherbot added the fixed label Feb 2, 2010

@mikioh mikioh changed the title xml.Unmarshal not parsing bool, int64 properly encoding/xml: Unmarshal not parsing bool, int64 properly Jan 9, 2015

@golang golang locked and limited conversation to collaborators Jun 24, 2016

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.