Created
May 19, 2012 18:55
-
-
Save mbeale/2731955 to your computer and use it in GitHub Desktop.
GO and XML sample3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
account Account | |
//resp is http.Response from http.Client | |
if body, readerr := ioutil.ReadAll(resp.Body); readerr == nil { | |
//load object xml | |
if xmlerr := xml.Unmarshal(body, &account); xmlerr != nil { | |
return xmlerr | |
} | |
} else { | |
//return read error | |
return readerr | |
} | |
//everything went fine | |
return nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment