From 64c9d551ba85f4b431989ae3c049a6876a65132e Mon Sep 17 00:00:00 2001 From: claw Date: Wed, 13 May 2026 11:44:28 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20address=20review=20feedback=20=E2=80=94?= =?UTF-8?q?=20restore=20timer.Stop()=20and=20fix=20test=20spacing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Restore timer.Stop() no-op in case <-timer.C for symmetry with ctx.Done - Add missing blank line between TestNoInsecureOption_RejectsHTTP and TestNoInsecureOption_RejectsUppercaseHTTP - Remove double blank line before TestAllowInsecureHTTP_WithoutEnvVar_Rejected Resolves review comments from sonnet-review-bot on PR #113. --- github/client.go | 1 + github/client_test.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/github/client.go b/github/client.go index a778d9c..dabb51d 100644 --- a/github/client.go +++ b/github/client.go @@ -319,6 +319,7 @@ func (c *Client) doRequest(ctx context.Context, method, reqURL string, accept st timer := time.NewTimer(delay) select { case <-timer.C: + timer.Stop() // no-op after fire; kept for symmetry with the ctx.Done case case <-ctx.Done(): timer.Stop() return nil, ctx.Err() diff --git a/github/client_test.go b/github/client_test.go index 3d5fa4e..6d2afa6 100644 --- a/github/client_test.go +++ b/github/client_test.go @@ -544,6 +544,7 @@ func TestNoInsecureOption_RejectsHTTP(t *testing.T) { t.Errorf("unexpected error message: %v", err) } } + func TestNoInsecureOption_RejectsUppercaseHTTP(t *testing.T) { // Verify case-insensitive scheme check (RFC 3986). c := NewClient("tok", "HTTP://example.com") @@ -568,7 +569,6 @@ func TestNoInsecureOption_RejectsMixedCaseHTTP(t *testing.T) { } } - func TestAllowInsecureHTTP_WithoutEnvVar_Rejected(t *testing.T) { srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { t.Fatal("request should not have been sent")