Fix errcheck lint findings in config, docker, and gitea
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful

Handle Fprintf/Close/RemoveAll return values so golangci-lint passes.

Claude-Session: https://claude.ai/code/session_015ur3i7D2azsMAWTSVABApv
This commit is contained in:
2026-07-26 23:43:30 +10:00
parent 1b4448afb4
commit 3be3f4cc46
3 changed files with 30 additions and 25 deletions
+2 -2
View File
@@ -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)