Improve copy function error checking + delete make fuzz because of https://github.com/golang/go/issues/52569

This commit is contained in:
David Dworken 2022-09-22 23:20:21 -07:00
parent 1df50731be
commit 9895a5c677
2 changed files with 6 additions and 5 deletions

View File

@ -5,9 +5,6 @@ forcetest:
test: test:
HISHTORY_TEST=1 go test -p 1 ./... HISHTORY_TEST=1 go test -p 1 ./...
fuzz:
HISHTORY_TEST=1 go test -p 1 -fuzz=FuzzTestMultipleUsers -run FuzzTestMultipleUsers client/client_test.go
acttest: acttest:
act push -j test -e .github/push_event.json --reuse --container-architecture linux/amd64 act push -j test -e .github/push_event.json --reuse --container-architecture linux/amd64

View File

@ -634,11 +634,15 @@ func copyFile(src, dst string) error {
if err != nil { if err != nil {
return err return err
} }
defer destination.Close()
_, err = io.Copy(destination, source) _, err = io.Copy(destination, source)
if err != nil {
return err return err
} }
return destination.Close()
}
func GetDownloadData() (shared.UpdateInfo, error) { func GetDownloadData() (shared.UpdateInfo, error) {
respBody, err := ApiGet("/api/v1/download") respBody, err := ApiGet("/api/v1/download")
if err != nil { if err != nil {