Skip to content

Instantly share code, notes, and snippets.

@mbeale
Created May 19, 2012 18:55
Show Gist options
  • Save mbeale/2731955 to your computer and use it in GitHub Desktop.
Save mbeale/2731955 to your computer and use it in GitHub Desktop.
GO and XML sample3
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