Skip to content

Commit

Permalink
fix: nil tempfile close warning on other errors
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Nov 16, 2023
1 parent 25a9287 commit 2c4d02c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ Environment variables:
return
}
cleanUpTempFile := func() {
if closeErr := tmpf.Close(); err != nil && !errors.Is(closeErr, os.ErrClosed) {
if closeErr := tmpf.Close(); closeErr != nil && !errors.Is(closeErr, os.ErrClosed) {
warnOut("close tempfile: %v", closeErr)
}
if rmErr := os.Remove(tmpf.Name()); rmErr != nil && !errors.Is(rmErr, os.ErrNotExist) {
Expand Down

0 comments on commit 2c4d02c

Please sign in to comment.