1
0
mirror of https://github.com/taigrr/yq synced 2025-01-18 04:53:17 -08:00

yq small fix

This commit is contained in:
Aleksandr Sergin 2019-08-26 16:08:19 +03:00 committed by Mike Farah
parent 8f5ffe47ff
commit e0d8cd6bf6

2
yq.go
View File

@ -633,13 +633,13 @@ func safelyRenameFile(from string, to string) {
if copyError := copyFileContents(from, to); copyError != nil {
log.Errorf("Failed copying from %v to %v", from, to)
log.Error(copyError.Error())
}
removeErr := os.Remove(from)
if removeErr != nil {
log.Errorf("failed removing original file: %s", from)
}
}
}
}
// thanks https://stackoverflow.com/questions/21060945/simple-way-to-copy-a-file-in-golang
func copyFileContents(src, dst string) (err error) {