| 1 | //go:build !windows |
| 2 | |
| 3 | package main |
| 4 | |
| 5 | import "os" |
| 6 | |
| 7 | // replaceLocalSaveDestination atomically replaces the destination on POSIX |
| 8 | // filesystems. Rename replaces a symlink itself, so a target swapped after the |
| 9 | // identity check cannot redirect the write into the source file. |
| 10 | func replaceLocalSaveDestination(temp, target string) error { |
| 11 | return os.Rename(temp, target) |
| 12 | } |
| 13 |