Return pointer instead of object
(Tests correction will come in a next commit)
This commit is contained in:
parent
7d465cb032
commit
b5825d2479
|
@ -11,7 +11,7 @@ import (
|
|||
// --------------------------------------------------
|
||||
type RSSFeed struct {
|
||||
XMLName xml.Name `xml:"rss"`
|
||||
Channel Channel
|
||||
Channel *Channel
|
||||
}
|
||||
|
||||
type Channel struct {
|
||||
|
@ -105,8 +105,8 @@ type Category struct {
|
|||
// --------------------------------------------------
|
||||
// Library Functions
|
||||
// --------------------------------------------------
|
||||
func Parse(xml_content []byte) (Channel, error) {
|
||||
var feed RSSFeed
|
||||
xml.Unmarshal(xml_content, &feed)
|
||||
func Parse(xml_content []byte) (*Channel, error) {
|
||||
var feed *RSSFeed
|
||||
xml.Unmarshal(xml_content, feed)
|
||||
return feed.Channel, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue