Answer the question
In order to leave comments, you need to log in
Why can't read rss correctly?
Hello. Wrote a small function for reading rss:
type Rss struct {
Channel Channel `xml:"channel"`
}
func parserRSS(link string) *Rss {
res, err := http.Get(link)
if err != nil {
fmt.Printf("Error: %v\n", err)
}
defer res.Body.Close()
rss := new(Rss)
decoded := xml.NewDecoder(res.Body)
err = decoded.Decode(rss)
if err != nil {
fmt.Printf("Error: %v\n", err)
}
return rss
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question