Created
January 22, 2020 20:59
-
-
Save affix/151ac2b28f6ec024acb91409ae273f06 to your computer and use it in GitHub Desktop.
XML to JSON in Go Parse XML
This file contains 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
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