Skip to content
Snippets Groups Projects
Unverified Commit 2869b591 authored by Alessio Caiazza's avatar Alessio Caiazza
Browse files

Fix removing file that may still be open

defer invocation are performed in LIFO order, we must close
a file before deleting it.

This is causing failures on windows when the cache file is larger
than 213000 KB
parent cde4a2d1
No related branches found
No related tags found
No related merge requests found
...@@ -42,8 +42,8 @@ func (c *CacheExtractorCommand) download() (bool, error) { ...@@ -42,8 +42,8 @@ func (c *CacheExtractorCommand) download() (bool, error) {
if err != nil { if err != nil {
return false, err return false, err
} }
defer file.Close()
defer os.Remove(file.Name()) defer os.Remove(file.Name())
defer file.Close()
resp, err := c.getClient().Get(c.URL) resp, err := c.getClient().Get(c.URL)
if err != nil { if err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment