diff options
| author | Petter Rasmussen | 2016-02-03 20:55:12 +0100 |
|---|---|---|
| committer | Petter Rasmussen | 2016-02-03 20:55:12 +0100 |
| commit | 658985444c127d43e17fb760b38174aa87d88258 (patch) | |
| tree | 7857cc7e56bccf1a676a902ecc5a12ab1b9170dd | |
| parent | 5f1972a0d689b9965fc3fb9f5b9a5f9487fb0f46 (diff) | |
| download | gdrive-658985444c127d43e17fb760b38174aa87d88258.tar.bz2 | |
Files are not mutated, no need to return
| -rw-r--r-- | drive/sync_download.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drive/sync_download.go b/drive/sync_download.go index ba86aae..7da16bd 100644 --- a/drive/sync_download.go +++ b/drive/sync_download.go @@ -39,7 +39,7 @@ func (self *Drive) DownloadSync(args DownloadSyncArgs) error { fmt.Fprintf(args.Out, "Found %d local files and %d remote files\n", len(files.local), len(files.remote)) // Create missing directories - files, err = self.createMissingLocalDirs(files, args) + err = self.createMissingLocalDirs(files, args) if err != nil { return err } @@ -88,7 +88,7 @@ func (self *Drive) getSyncRoot(rootId string) (*drive.File, error) { return f, nil } -func (self *Drive) createMissingLocalDirs(files *syncFiles, args DownloadSyncArgs) (*syncFiles, error) { +func (self *Drive) createMissingLocalDirs(files *syncFiles, args DownloadSyncArgs) error { missingDirs := files.filterMissingLocalDirs() missingCount := len(missingDirs) @@ -102,7 +102,7 @@ func (self *Drive) createMissingLocalDirs(files *syncFiles, args DownloadSyncArg for i, rf := range missingDirs { path, err := filepath.Abs(filepath.Join(args.Path, rf.relPath)) if err != nil { - return nil, fmt.Errorf("Failed to determine local absolute path: %s", err) + return fmt.Errorf("Failed to determine local absolute path: %s", err) } fmt.Fprintf(args.Out, "[%04d/%04d] Creating directory: %s\n", i + 1, missingCount, path) @@ -113,7 +113,7 @@ func (self *Drive) createMissingLocalDirs(files *syncFiles, args DownloadSyncArg mkdir(path) } - return files, nil + return nil } func (self *Drive) downloadMissingFiles(files *syncFiles, args DownloadSyncArgs) error { |
