From c6c5aaf48eb96c9c2f045dcf6a472575a52f47e8 Mon Sep 17 00:00:00 2001 From: user Date: Fri, 20 Feb 2026 03:19:19 -0800 Subject: [PATCH] fix: resolve noctx lint issues --- cmd/chat-cli/api/client.go | 5 +++-- internal/db/db.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/chat-cli/api/client.go b/cmd/chat-cli/api/client.go index 01ce582..51b5b0b 100644 --- a/cmd/chat-cli/api/client.go +++ b/cmd/chat-cli/api/client.go @@ -3,6 +3,7 @@ package api import ( "bytes" + "context" "encoding/json" "errors" "fmt" @@ -49,7 +50,7 @@ func (c *Client) do(method, path string, body any) ([]byte, error) { bodyReader = bytes.NewReader(data) } - req, err := http.NewRequest(method, c.BaseURL+path, bodyReader) + req, err := http.NewRequestWithContext(context.Background(), method, c.BaseURL+path, bodyReader) if err != nil { return nil, fmt.Errorf("request: %w", err) } @@ -138,7 +139,7 @@ func (c *Client) PollMessages(afterID string, timeout int) ([]Message, error) { path += "?" + params.Encode() } - req, err := http.NewRequest(http.MethodGet, c.BaseURL+path, nil) + req, err := http.NewRequestWithContext(context.Background(), http.MethodGet, c.BaseURL+path, nil) if err != nil { return nil, err } diff --git a/internal/db/db.go b/internal/db/db.go index c0009a5..cf4376f 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -88,7 +88,7 @@ func NewTest(dsn string) (*Database, error) { } // Item 9: Enable foreign keys - if _, err := d.Exec("PRAGMA foreign_keys = ON"); err != nil { + if _, err := d.ExecContext(context.Background(), "PRAGMA foreign_keys = ON"); err != nil { _ = d.Close() return nil, fmt.Errorf("enable foreign keys: %w", err)