Browse Source

Fix function comments based on best practices from Effective Go

Signed-off-by: CodeLingo Bot <bot@codelingo.io>
pull/65/head
CodeLingo Bot 6 years ago committed by Kamil Kisiel
parent
commit
899df4f557
  1. 4
      atom.go
  2. 6
      feed.go
  3. 4
      rss.go

4
atom.go

@ -158,12 +158,12 @@ func (a *Atom) AtomFeed() *AtomFeed {
return feed
}
// return an XML-Ready object for an Atom object
// FeedXml returns an XML-Ready object for an Atom object
func (a *Atom) FeedXml() interface{} {
return a.AtomFeed()
}
// return an XML-ready object for an AtomFeed object
// FeedXml returns an XML-ready object for an AtomFeed object
func (a *AtomFeed) FeedXml() interface{} {
return a
}

6
feed.go

@ -85,7 +85,7 @@ func ToXML(feed XmlFeed) (string, error) {
return s, nil
}
// Write a feed object (either a Feed, AtomFeed, or RssFeed) as XML into
// WriteXML writes a feed object (either a Feed, AtomFeed, or RssFeed) as XML into
// the writer. Returns an error if XML marshaling fails.
func WriteXML(feed XmlFeed, w io.Writer) error {
x := feed.FeedXml()
@ -104,7 +104,7 @@ func (f *Feed) ToAtom() (string, error) {
return ToXML(a)
}
// Writes an Atom representation of this feed to the writer.
// WriteAtom writes an Atom representation of this feed to the writer.
func (f *Feed) WriteAtom(w io.Writer) error {
return WriteXML(&Atom{f}, w)
}
@ -115,7 +115,7 @@ func (f *Feed) ToRss() (string, error) {
return ToXML(r)
}
// Writes an RSS representation of this feed to the writer.
// WriteRss writes an RSS representation of this feed to the writer.
func (f *Feed) WriteRss(w io.Writer) error {
return WriteXML(&Rss{f}, w)
}

4
rss.go

@ -151,14 +151,14 @@ func (r *Rss) RssFeed() *RssFeed {
return channel
}
// return an XML-Ready object for an Rss object
// FeedXml returns an XML-Ready object for an Rss object
func (r *Rss) FeedXml() interface{} {
// only generate version 2.0 feeds for now
return r.RssFeed().FeedXml()
}
// return an XML-ready object for an RssFeed object
// FeedXml returns an XML-ready object for an RssFeed object
func (r *RssFeed) FeedXml() interface{} {
return &RssFeedXml{
Version: "2.0",

Loading…
Cancel
Save