diff options
author | Nick White <git@njw.name> | 2019-12-05 18:19:13 +0000 |
---|---|---|
committer | Nick White <git@njw.name> | 2019-12-05 18:19:13 +0000 |
commit | b545cdbb19a2f6a1d3970c26b600eab27ffedfa3 (patch) | |
tree | 1c4f0865a88e4c80705612cb3c1a7a0ebefd6a74 | |
parent | 2318b478fc2769ca09590006d8483463ae763b22 (diff) |
Remove (the generally empty) files in the case of a failed download
-rw-r--r-- | aws.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -317,6 +317,9 @@ func (a *AwsConn) Download(bucket string, key string, path string) error { Bucket: aws.String(bucket), Key: &key, }) + if err != nil { + _ = os.Remove(path) + } return err } |