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