From 4a813e4058adbcd26849c01961b0dc71fe831c85 Mon Sep 17 00:00:00 2001 From: Brian Gitonga Marete Date: Tue, 29 Oct 2013 15:55:27 +0900 Subject: [PATCH] blog: Fix atom feed's `updated' time when there's only one article. When computing the time for the "updated" tag of the atom feed, the current code checks if there is more than one article and if that is not true, it sets the time to the zero time.Time. This means that the feed also gets the zero time in this tag when there is exactly one article. This trivial patch fixes this so that when there is exactly one article, the time is set to that article's time. R=golang-dev, adg CC=golang-dev https://golang.org/cl/18420044 --- blog/blog.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/blog.go b/blog/blog.go index afb00503a5..7c6b00a3f5 100644 --- a/blog/blog.go +++ b/blog/blog.go @@ -259,7 +259,7 @@ func (s *Server) loadDocs(root string) error { // atomFeed field. func (s *Server) renderAtomFeed() error { var updated time.Time - if len(s.docs) > 1 { + if len(s.docs) > 0 { updated = s.docs[0].Time } feed := atom.Feed{