From e2ad3a4600017ee225ca0b33b185fa9d9edcfe60 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 6 May 2026 18:26:59 -0400 Subject: [PATCH] =?UTF-8?q?fix(server/m7-cover-sources):=20forward-fix=20C?= =?UTF-8?q?I=20=E2=80=94=20more=20unused=20r=20params?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sweep round 4: 5 more httptest handlers in provider_theaudiodb_test.go where r is unused. Lint flagged 3 (lines 89/103/118); also fixing 2 more (TestConnection_SuccessOnEmptyAlbum, FailureOn401) that lint would catch on the next run. The 4 handlers that DO use r.URL.Path or r.Host are left as-is. --- internal/coverart/provider_theaudiodb_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/coverart/provider_theaudiodb_test.go b/internal/coverart/provider_theaudiodb_test.go index 7e7dd666..8fdc0838 100644 --- a/internal/coverart/provider_theaudiodb_test.go +++ b/internal/coverart/provider_theaudiodb_test.go @@ -86,7 +86,7 @@ func TestTheAudioDB_FetchAlbumCover_Success(t *testing.T) { } func TestTheAudioDB_FetchAlbumCover_NotFound(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json") _, _ = w.Write([]byte(`{"album":null}`)) })) @@ -100,7 +100,7 @@ func TestTheAudioDB_FetchAlbumCover_NotFound(t *testing.T) { } func TestTheAudioDB_FetchAlbumCover_NullThumbURL(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json") _, _ = w.Write([]byte(`{"album":[{"strAlbumThumb":null}]}`)) })) @@ -115,7 +115,7 @@ func TestTheAudioDB_FetchAlbumCover_NullThumbURL(t *testing.T) { func TestTheAudioDB_FetchAlbumCover_429TriggersRetry(t *testing.T) { var attempts atomic.Int32 - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { n := attempts.Add(1) if n == 1 { http.Error(w, "rate limit", http.StatusTooManyRequests) @@ -265,7 +265,7 @@ func TestTheAudioDB_DisabledReturnsNotFound(t *testing.T) { } func TestTheAudioDB_TestConnection_SuccessOnEmptyAlbum(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json") _, _ = w.Write([]byte(`{"album":null}`)) })) @@ -278,7 +278,7 @@ func TestTheAudioDB_TestConnection_SuccessOnEmptyAlbum(t *testing.T) { } func TestTheAudioDB_TestConnection_FailureOn401(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { http.Error(w, "unauthorized", http.StatusUnauthorized) })) defer srv.Close()