Skip to content

Instantly share code, notes, and snippets.

@affix
Last active January 22, 2020 20:31
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/a7ad01410b0452c0c7109dddc4c89de9 to your computer and use it in GitHub Desktop.
Save affix/a7ad01410b0452c0c7109dddc4c89de9 to your computer and use it in GitHub Desktop.
XML to JSON in GoLang Demystified getting the feed
func Handle(req []byte) string {
resp, err := http.Get("https://medium.com/feed/@" + string(req)) // Use the 'req' variable to build our feed URL
// Standard Error Handler
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close() // Defer closing until the Handle function returns
body, _ := ioutil.ReadAll(resp.Body) // Read the response body and ignore errors
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment