Use range for loop.

This commit is contained in:
Martin Dosch 2024-11-30 10:14:48 +01:00
parent 4708bd326e
commit 7dfe7115e1

View file

@ -84,8 +84,8 @@ func main() {
for {
// Check all configured feeds for new articles and send
// new articles to configured MUC.
for i := 0; i < len(config.Feeds); i++ {
output, err := getArticles(config.Feeds[i], config.MaxArticles, config.NoExcerpt, config.Filter, config.FilterMessage)
for _, confFeed := range config.Feeds {
output, err := getArticles(confFeed, config.MaxArticles, config.NoExcerpt, config.Filter, config.FilterMessage)
if err != nil {
// Exit if an error occurs checking the feeds.
log.Fatal("Error: Can't check feeds for new articles: ", err)