diff --git a/main.go b/main.go index 51aeb9a..27940ad 100644 --- a/main.go +++ b/main.go @@ -89,8 +89,12 @@ func main() { if err != nil { return } - defer file.Close() - io.Copy(hctx.BodyWriter(), file) + defer func() { + file.Close() + os.Remove(outputPath) + fmt.Println("File removed after download") + }() + _, _ = io.Copy(hctx.BodyWriter(), file) } return output, nil })