From c8758ff22d986a98e4959e99b6815be2dba23d7e Mon Sep 17 00:00:00 2001 From: Matthew Dawson Date: Sun, 7 Jul 2013 12:49:14 -0400 Subject: [PATCH 1/2] Add the author to the item in an rss feed. The author was missing from the generated rss feed's items. This adds it back, but only uses the name for now. --- feed_test.go | 1 + rss.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/feed_test.go b/feed_test.go index 99f0dd8..2794059 100644 --- a/feed_test.go +++ b/feed_test.go @@ -57,6 +57,7 @@ var rssOutput = ` Limiting Concurrency in Go http://jmoiron.net/blog/limiting-concurrency-in-go/ A discussion on controlled parallelism in golang + Jason Moiron 2013-01-16T21:52:35-05:00 diff --git a/rss.go b/rss.go index 651258f..2c8796f 100644 --- a/rss.go +++ b/rss.go @@ -92,6 +92,9 @@ func newRssItem(i *Item) *RssItem { Guid: i.Id, PubDate: anyTimeFormat(time.RFC3339, i.Created, i.Updated), } + if i.Author != nil { + item.Author = i.Author.Name + } return item } From 0026358364be9ce3c4ae60e3d961de8e52562e6f Mon Sep 17 00:00:00 2001 From: Matthew Dawson Date: Sun, 7 Jul 2013 12:50:18 -0400 Subject: [PATCH 2/2] Fix the tests to work correctly. It appears that go's xml package changed the text it would output. It is semantically the same, so just update the expected output. --- feed_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/feed_test.go b/feed_test.go index 2794059..607d008 100644 --- a/feed_test.go +++ b/feed_test.go @@ -5,8 +5,7 @@ import ( "time" ) -var atomOutput = ` - +var atomOutput = ` jmoiron.net blog http://jmoiron.net/blog 2013-01-16T21:52:35-05:00 @@ -44,8 +43,7 @@ var atomOutput = ` ` -var rssOutput = ` - +var rssOutput = ` jmoiron.net blog http://jmoiron.net/blog