Saturday 15 September 2012

go - Unable to Unmarshal a payload with spaces in values -


I am using Goolg to read the XML response. I can not read the values ​​properly with the blank space.

Here's an abstract:

Is there a way to keep XML? Universal & lt; Results & gt; Trim the values ​​from and then it's an int?

Come

but

     

Even the xml "1" is a string and no int Parser can not parse this string in an int. So 0 is the default int value,

if you change your code:

  err: = xml.Unmarshal ([] byte (payload), & amp; amp; ; Amp; mt) If mistake! = Void   

No comments:

Post a Comment