Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Simplify uploading backups #324

Merged
merged 1 commit into from
May 27, 2020
Merged

Conversation

johngmyers
Copy link
Contributor

Remove the dependency on vfs.CopyFile(), which internally copies to a second temporary file.

if err := vfs.CopyFile(srcPath, destPath, nil); err != nil {
return "", fmt.Errorf("error copying %q to %q: %v", srcPath, destPath, err)
err = destPath.WriteFile(f, nil)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Total nit): you can combine this into if err := destPath.WriteFile(...); err != nil {

Copy link
Contributor

@justinsb justinsb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - well spotted and a nice fix.

/approve
/lgtm

@justinsb justinsb merged commit 18116e4 into kopeio:master May 27, 2020
@johngmyers johngmyers deleted the simplify-backup branch May 27, 2020 06:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants