Skip to content

Commit

Permalink
fix test fail
Browse files Browse the repository at this point in the history
  • Loading branch information
DexterYan committed Feb 4, 2025
1 parent 33f0e60 commit 26ad582
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions pkg/collect/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,6 @@ func (r CollectorResult) ReplaceResult(bundlePath string, relativePath string, r
return errors.Wrap(err, "failed to create temp file")
}

// Ensure the temp file is closed and deleted if there's an error
defer func() {
tmpFile.Close()
// Remove temp file if the rename fails
if err != nil {
os.Remove(tmpFile.Name())
}
}()

// Write data to the temporary file
_, err = io.Copy(tmpFile, reader)
if err != nil {
Expand Down

0 comments on commit 26ad582

Please sign in to comment.