Fix errcheck lint findings in config, docker, and gitea
Handle Fprintf/Close/RemoveAll return values so golangci-lint passes. Claude-Session: https://claude.ai/code/session_015ur3i7D2azsMAWTSVABApv
This commit is contained in:
@@ -47,7 +47,7 @@ func (c *Client) get(ctx context.Context, path string, query url.Values, out any
|
||||
if err != nil {
|
||||
return fmt.Errorf("GET %s: %w", path, err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
body, _ := io.ReadAll(resp.Body)
|
||||
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
|
||||
return fmt.Errorf("GET %s: status %d: %s", path, resp.StatusCode, strings.TrimSpace(string(body)))
|
||||
@@ -194,7 +194,7 @@ func (c *Client) GetPullDiff(ctx context.Context, repo string, index int64) (str
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
body, _ := io.ReadAll(resp.Body)
|
||||
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
|
||||
return "", fmt.Errorf("GET pull diff: status %d", resp.StatusCode)
|
||||
|
||||
Reference in New Issue
Block a user