diff --git a/main.go b/main.go index 5a9a2b9..0119bd9 100644 --- a/main.go +++ b/main.go @@ -29,19 +29,23 @@ func main() { items = filterEntriesAfter(items, now.With(time.Now()).Monday()) - outputEntries(items) -} - -func outputEntries(items []microsub.Item) { - t, err := template.ParseFiles("templates/weekly.html") + err = outputEntries(items) if err != nil { log.Fatal(err) } +} + +func outputEntries(items []microsub.Item) error { + t, err := template.ParseFiles("templates/weekly.html") + if err != nil { + return err + } err = t.Execute(os.Stdout, items) if err != nil { - log.Fatal(err) + return err } + return nil } func getEntriesForFeed(u *url.URL) ([]microsub.Item, error) {