| 1 | //go:build windows |
| 2 | |
| 3 | package main |
| 4 | |
| 5 | import "golang.org/x/sys/windows" |
| 6 | |
| 7 | // windows.Rename uses MoveFileEx(MOVEFILE_REPLACE_EXISTING), preserving the |
| 8 | // old destination when replacement fails instead of deleting it first. |
| 9 | func replaceLocalSaveDestination(temp, target string) error { |
| 10 | return windows.Rename(temp, target) |
| 11 | } |
| 12 |