Skip to content

Instantly share code, notes, and snippets.

@affix
Created January 22, 2020 20:52
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/75e53f76c17acaae18c50ed8ec539e8f to your computer and use it in GitHub Desktop.
Save affix/75e53f76c17acaae18c50ed8ec539e8f to your computer and use it in GitHub Desktop.
XML to JSON in Go the PostData Structure
type PostData struct {
Channel struct {
Posts []struct {
Title string `xml:"title"`
Link string `xml:"link"`
Category []string `xml:"category"`
Creator string `xml:"creator"`
PubDate string `xml:"pubDate"`
Updated string `xml:"updated"`
License string `xml:"license"`
Encoded string `xml:"encoded"`
Description string `xml:"description"`
} `xml:"item"`
} `xml:"channel"`
}
// Handle a serverless request
func Handle(req []byte) string {
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment