Last active
January 22, 2020 20:31
-
-
Save affix/a7ad01410b0452c0c7109dddc4c89de9 to your computer and use it in GitHub Desktop.
XML to JSON in GoLang Demystified getting the feed
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 { | |
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