convert error fromating to %w everywhere (#6995)

This commit is contained in:
Chris Lu
2025-07-16 23:39:27 -07:00
committed by GitHub
parent a524b4f485
commit 69553e5ba6
174 changed files with 524 additions and 524 deletions

View File

@@ -69,12 +69,12 @@ func (c *Client) sendProtobuf(data *proto.TelemetryData) error {
body, err := protobuf.Marshal(req)
if err != nil {
return fmt.Errorf("failed to marshal protobuf: %v", err)
return fmt.Errorf("failed to marshal protobuf: %w", err)
}
httpReq, err := http.NewRequest("POST", c.url, bytes.NewBuffer(body))
if err != nil {
return fmt.Errorf("failed to create request: %v", err)
return fmt.Errorf("failed to create request: %w", err)
}
httpReq.Header.Set("Content-Type", "application/x-protobuf")
@@ -82,7 +82,7 @@ func (c *Client) sendProtobuf(data *proto.TelemetryData) error {
resp, err := c.httpClient.Do(httpReq)
if err != nil {
return fmt.Errorf("failed to send request: %v", err)
return fmt.Errorf("failed to send request: %w", err)
}
defer resp.Body.Close()