Skip to content

Commit

Permalink
Fix function comments based on best practices from Effective Go
Browse files Browse the repository at this point in the history
Signed-off-by: CodeLingo Bot <bot@codelingo.io>
  • Loading branch information
CodeLingoBot authored and kisielk committed Feb 20, 2019
1 parent 8df78d2 commit 899df4f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions atom.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 3 additions & 3 deletions feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
}
Expand All @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions rss.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 899df4f

Please sign in to comment.