Skip to content
Permalink
Browse files

pkg/osutil: always remove old file in Rename

  • Loading branch information...
dvyukov committed Dec 20, 2018
1 parent aaf59e8 commit dbe573e3b80b776ce7b2be55f7feee23502813ea
Showing with 2 additions and 1 deletion.
  1. +2 −1 pkg/osutil/fileutil.go
@@ -45,7 +45,8 @@ func Rename(oldFile, newFile string) error {
err := os.Rename(oldFile, newFile)
if err != nil {
// Can't use syscall.EXDEV because this is used in appengine app.
return CopyFile(oldFile, newFile)
err = CopyFile(oldFile, newFile)
os.Remove(oldFile)
}
return err
}

0 comments on commit dbe573e

Please sign in to comment.
You can’t perform that action at this time.