diff options
Diffstat (limited to 'drive')
| -rw-r--r-- | drive/upload.go | 6 | ||||
| -rw-r--r-- | drive/upload_sync.go | 6 | 
2 files changed, 12 insertions, 0 deletions
| diff --git a/drive/upload.go b/drive/upload.go index 1e145f7..3a1a34c 100644 --- a/drive/upload.go +++ b/drive/upload.go @@ -59,6 +59,9 @@ func (self *Drive) uploadDirectory(args UploadArgs) error {          return err      } +    // Close file on function exit +    defer srcFile.Close() +      // Make directory on drive      f, err := self.mkdir(MkdirArgs{          Out: args.Out, @@ -98,6 +101,9 @@ func (self *Drive) uploadFile(args UploadArgs) (*drive.File, error) {          return nil, err      } +    // Close file on function exit +    defer srcFile.Close() +      // Instantiate empty drive file      dstFile := &drive.File{} 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{} | 
