diff --git a/openring.go b/openring.go index 9684672..1a8c79f 100644 --- a/openring.go +++ b/openring.go @@ -118,6 +118,9 @@ func main() { sort.Slice(articles, func(i, j int) bool { return articles[i].Date.After(articles[j].Date) }) + if len(articles) < narticles { + narticles = len(articles) + } articles = articles[:narticles] err = tmpl.Execute(os.Stdout, struct{ Articles []*Article