Skip to content

Commit c6f1afe

Browse files
authored
Merge pull request #144 from keyxmakerx/claude/foundry-module-setup-ZjHlL
fix: resolve errcheck lint errors in packages plugin
2 parents da1ac70 + afa4fae commit c6f1afe

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

internal/plugins/packages/github_client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (c *GitHubClient) ListReleases(ctx context.Context, repoURL string) ([]GitH
8181
if err != nil {
8282
return nil, fmt.Errorf("fetching releases: %w", err)
8383
}
84-
defer resp.Body.Close()
84+
defer func() { _ = resp.Body.Close() }()
8585

8686
if resp.StatusCode != http.StatusOK {
8787
body, _ := io.ReadAll(io.LimitReader(resp.Body, 1024))
@@ -112,7 +112,7 @@ func (c *GitHubClient) DownloadAsset(ctx context.Context, downloadURL, destPath
112112
if err != nil {
113113
return 0, fmt.Errorf("downloading asset: %w", err)
114114
}
115-
defer resp.Body.Close()
115+
defer func() { _ = resp.Body.Close() }()
116116

117117
if resp.StatusCode != http.StatusOK {
118118
return 0, fmt.Errorf("download returned HTTP %d", resp.StatusCode)

internal/plugins/packages/service.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ func extractZip(zipPath, destDir string) error {
558558
if err != nil {
559559
return fmt.Errorf("opening zip: %w", err)
560560
}
561-
defer zr.Close()
561+
defer func() { _ = zr.Close() }()
562562

563563
for _, zf := range zr.File {
564564
// Security: reject path traversal.
@@ -593,7 +593,7 @@ func extractSingleFile(zf *zip.File, destPath string) error {
593593
if err != nil {
594594
return fmt.Errorf("opening %s in zip: %w", zf.Name, err)
595595
}
596-
defer rc.Close()
596+
defer func() { _ = rc.Close() }()
597597

598598
out, err := os.Create(destPath)
599599
if err != nil {

0 commit comments

Comments
 (0)