From 1a6ca080e2a4640a1d5bc3dbe0030e68db580cbe Mon Sep 17 00:00:00 2001 From: Shuhao Qing Date: Wed, 28 Aug 2024 13:45:30 +0800 Subject: [PATCH] nit --- pkg/cmd/record/download.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/record/download.go b/pkg/cmd/record/download.go index fd00fbd..2df44b5 100644 --- a/pkg/cmd/record/download.go +++ b/pkg/cmd/record/download.go @@ -81,10 +81,10 @@ func NewDownloadCommand(cfgPath *string) *cobra.Command { fmt.Printf("Saving to %s\n", dstDir) successCount := 0 - for _, f := range files { + for fIdx, f := range files { fileName, _ := name.NewFile(f.Name) localPath := filepath.Join(dstDir, fileName.Filename) - fmt.Printf("\nDownloading #%d file: %s\n", successCount+1, fileName.Filename) + fmt.Printf("\nDownloading #%d file: %s\n", fIdx+1, fileName.Filename) if !strings.HasPrefix(localPath, dstDir+string(os.PathSeparator)) { log.Errorf("illegal file name: %s", fileName.Filename) @@ -120,7 +120,7 @@ func NewDownloadCommand(cfgPath *string) *cobra.Command { successCount++ } - fmt.Printf("\nDownload completed! \nAll %d/%d files are saved to %s\n", successCount, len(files), dstDir) + fmt.Printf("\nDownload completed! \nAll %d / %d files are saved to %s\n", successCount, len(files), dstDir) }, }