Created
January 22, 2020 20:52
-
-
Save affix/75e53f76c17acaae18c50ed8ec539e8f to your computer and use it in GitHub Desktop.
XML to JSON in Go the PostData Structure
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
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