mirror of
https://github.com/versity/versitygw.git
synced 2026-04-22 21:50:29 +00:00
On Windows, a file apparently cannot be renamed while an open handle to it exists. The previous code used defer tempfile.Close(), which meant the handle was still open when os.Rename was called, producing: failed to rename temporary file: The process cannot access the file because it is being used by another process. Fix by closing the file explicitly before the rename. Fixes #2021