Commit e892273
authored
chore: defer file closes (#1180)
## What?
Replaced manual `Close()` calls on every error path in the binary copy
block of `runUpdateCLI` with `defer`, and report close errors on `out`
via the named return value.
## Why?
The previous manual `Close()` calls on every return path were fragile
and silently discarded flush errors on `out`.
Closes #10561 parent 6780894 commit e892273
1 file changed
Lines changed: 12 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3371 | 3371 | | |
3372 | 3372 | | |
3373 | 3373 | | |
3374 | | - | |
| 3374 | + | |
3375 | 3375 | | |
3376 | 3376 | | |
3377 | 3377 | | |
| |||
3638 | 3638 | | |
3639 | 3639 | | |
3640 | 3640 | | |
| 3641 | + | |
3641 | 3642 | | |
3642 | 3643 | | |
3643 | | - | |
3644 | 3644 | | |
3645 | 3645 | | |
3646 | | - | |
3647 | | - | |
3648 | | - | |
| 3646 | + | |
| 3647 | + | |
| 3648 | + | |
| 3649 | + | |
| 3650 | + | |
| 3651 | + | |
| 3652 | + | |
| 3653 | + | |
| 3654 | + | |
3649 | 3655 | | |
3650 | 3656 | | |
3651 | | - | |
3652 | | - | |
3653 | 3657 | | |
3654 | 3658 | | |
3655 | 3659 | | |
| |||
3661 | 3665 | | |
3662 | 3666 | | |
3663 | 3667 | | |
3664 | | - | |
| 3668 | + | |
3665 | 3669 | | |
3666 | 3670 | | |
3667 | 3671 | | |
| |||
0 commit comments