Return pointer instead of object

(Tests correction will come in a next commit)
This commit is contained in:
Nicolas Wavrant 2019-03-23 23:05:10 +09:00
parent 7d465cb032
commit b5825d2479
1 changed files with 4 additions and 4 deletions

View File

@ -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
}