fix: resolve noctx lint issues
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user