Skip to content

Commit

Permalink
Close sh.Copy destination file descriptor (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasrmichel authored and natefinch committed Jan 24, 2019
1 parent 8c70a98 commit 5dee1ad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sh/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func Copy(dst string, src string) error {
if err != nil {
return fmt.Errorf(`can't copy to %s: %v`, dst, err)
}
defer to.Close()
_, err = io.Copy(to, from)
if err != nil {
return fmt.Errorf(`error copying %s to %s: %v`, src, dst, err)
Expand Down

0 comments on commit 5dee1ad

Please sign in to comment.