Skip to content

Commit

Permalink
pkg/osutil: always remove old file in Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
dvyukov committed Dec 20, 2018
1 parent aaf59e8 commit dbe573e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/osutil/fileutil.go
Expand Up @@ -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
}
Expand Down

0 comments on commit dbe573e

Please sign in to comment.