Skip to content

Commit 4587441

Browse files
committed
catch missing errors
1 parent 9fd038d commit 4587441

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

go/cmd/bundler/main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,9 @@ func downloadCLIBinary(npmPlatform, binaryName, cliVersion, destDir string) (str
384384
tarballFile.Close()
385385
return "", fmt.Errorf("failed to save tarball: %w", err)
386386
}
387-
tarballFile.Close()
387+
if err := tarballFile.Close(); err != nil {
388+
return "", fmt.Errorf("failed to close tarball file: %w", err)
389+
}
388390

389391
// Extract only the CLI binary to avoid unpacking the full package tree.
390392
binaryPath := filepath.Join(destDir, binaryName)
@@ -525,7 +527,9 @@ func extractFileFromTarball(tarballPath, destDir, targetPath, outputName string)
525527
outFile.Close()
526528
return fmt.Errorf("failed to extract binary: %w", err)
527529
}
528-
outFile.Close()
530+
if err := outFile.Close(); err != nil {
531+
return fmt.Errorf("failed to close output file: %w", err)
532+
}
529533
return nil
530534
}
531535
}

0 commit comments

Comments
 (0)