From cb72292b83a96b1a93676d6a8f2b0480694fae64 Mon Sep 17 00:00:00 2001 From: shankar0123 Date: Fri, 3 Apr 2026 21:08:21 -0400 Subject: [PATCH] fix: use tagged switch for staticcheck QF1002 in sectigo tests Convert 3 untagged switch statements to tagged `switch r.URL.Path {}` form to satisfy staticcheck QF1002. No behavioral change. Co-Authored-By: Claude Opus 4.6 --- .../connector/issuer/sectigo/sectigo_test.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/connector/issuer/sectigo/sectigo_test.go b/internal/connector/issuer/sectigo/sectigo_test.go index 9b390e8..e9347b6 100644 --- a/internal/connector/issuer/sectigo/sectigo_test.go +++ b/internal/connector/issuer/sectigo/sectigo_test.go @@ -250,11 +250,11 @@ func TestSectigoConnector(t *testing.T) { t.Run("IssueCertificate_Pending", func(t *testing.T) { srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - switch { - case r.URL.Path == "/ssl/v1/enroll": + switch r.URL.Path { + case "/ssl/v1/enroll": w.WriteHeader(http.StatusOK) w.Write([]byte(`{"sslId":55002}`)) - case r.URL.Path == "/ssl/v1/55002": + case "/ssl/v1/55002": w.WriteHeader(http.StatusOK) w.Write([]byte(`{"sslId":55002,"status":"Applied","commonName":"secure.example.com"}`)) default: @@ -470,11 +470,11 @@ func TestSectigoConnector(t *testing.T) { t.Run("RenewCertificate_NewOrder", func(t *testing.T) { srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - switch { - case r.URL.Path == "/ssl/v1/enroll": + switch r.URL.Path { + case "/ssl/v1/enroll": w.WriteHeader(http.StatusOK) w.Write([]byte(`{"sslId":55010}`)) - case r.URL.Path == "/ssl/v1/55010": + case "/ssl/v1/55010": w.WriteHeader(http.StatusOK) w.Write([]byte(`{"sslId":55010,"status":"Applied"}`)) default: @@ -680,11 +680,11 @@ func TestSectigoConnector(t *testing.T) { t.Errorf("Request %d: expected password 'verify-pass', got '%s'", requestCount, r.Header.Get("password")) } - switch { - case r.URL.Path == "/ssl/v1/enroll": + switch r.URL.Path { + case "/ssl/v1/enroll": w.WriteHeader(http.StatusOK) w.Write([]byte(`{"sslId":55050}`)) - case r.URL.Path == "/ssl/v1/55050": + case "/ssl/v1/55050": w.WriteHeader(http.StatusOK) w.Write([]byte(`{"sslId":55050,"status":"Applied"}`)) default: