From a55bb7e15b30bfb22fb69d4dc4ebb96e7cb383f0 Mon Sep 17 00:00:00 2001 From: vikingowl Date: Sat, 18 Apr 2026 12:48:38 +0200 Subject: [PATCH] docs(discovery/crawler): clarify unused year param in parseDateAttr --- .../domain/discovery/crawler/festival_alarm.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/internal/domain/discovery/crawler/festival_alarm.go b/backend/internal/domain/discovery/crawler/festival_alarm.go index ae1c661..f1c1496 100644 --- a/backend/internal/domain/discovery/crawler/festival_alarm.go +++ b/backend/internal/domain/discovery/crawler/festival_alarm.go @@ -120,10 +120,13 @@ func parseFestivalAlarm(data []byte, sourceURL string, year int) ([]RawEvent, er return events, nil } -// parseDateAttr reads the content="YYYY-MM-DD" attribute from a span and -// returns a *time.Time in UTC. Falls back to year for the year component if -// the attribute is absent or malformed (shouldn't happen in practice). +// parseDateAttr reads the content="YYYY-MM-DD" attribute from an itemprop +// span and returns a *time.Time in UTC. Returns nil if absent or malformed. +// The year parameter is accepted for signature symmetry with future sources +// that may not include full dates in their markup; it is intentionally unused +// here because festival-alarm always emits complete ISO dates. func parseDateAttr(s *goquery.Selection, year int) *time.Time { + _ = year content, exists := s.Attr("content") if !exists || content == "" { return nil @@ -132,7 +135,5 @@ func parseDateAttr(s *goquery.Selection, year int) *time.Time { if err != nil { return nil } - // The site always includes the correct year in the attribute; just validate. - _ = year return &t }