Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
This commit is contained in:
Krasi Georgiev 2019-06-24 11:51:49 +03:00
parent fe3d374586
commit 251c3a4d64

View file

@ -129,7 +129,7 @@ func Rename(from, to string) error {
// It is not atomic. // It is not atomic.
func Replace(from, to string) error { func Replace(from, to string) error {
// Remove destination only if it is a dir otherwise leave it to os.Rename // Remove destination only if it is a dir otherwise leave it to os.Rename
// as it replaces the destination when it is file and is atomic. // as it replaces the destination file and is atomic.
{ {
f, err := os.Stat(to) f, err := os.Stat(to)
if !os.IsNotExist(err) { if !os.IsNotExist(err) {