Skip to content

Instantly share code, notes, and snippets.

@affix
Created January 22, 2020 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save affix/151ac2b28f6ec024acb91409ae273f06 to your computer and use it in GitHub Desktop.
Save affix/151ac2b28f6ec024acb91409ae273f06 to your computer and use it in GitHub Desktop.
XML to JSON in Go Parse XML
func Handle(req []byte) string {
// ...
data := &PostData{} // Create and initialise a data variable as a PostData struct
err = xml.Unmarshal(body, data) // Parse the XML into the structure
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment