diff options
Diffstat (limited to 'drive/upload_sync.go')
| -rw-r--r-- | drive/upload_sync.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drive/upload_sync.go b/drive/upload_sync.go index a2a0640..66e1456 100644 --- a/drive/upload_sync.go +++ b/drive/upload_sync.go @@ -227,6 +227,9 @@ func (self *Drive) uploadMissingFile(parentId string, lf *localFile, args Upload return fmt.Errorf("Failed to open file: %s", err) } + // Close file on function exit + defer srcFile.Close() + // Instantiate drive file dstFile := &drive.File{ Name: lf.info.Name(), @@ -254,6 +257,9 @@ func (self *Drive) updateChangedFile(cf *changedFile, args UploadSyncArgs) error return fmt.Errorf("Failed to open file: %s", err) } + // Close file on function exit + defer srcFile.Close() + // Instantiate drive file dstFile := &drive.File{} |
