Skip to content

Commit

Permalink
fix: linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Ja7ad committed Jul 18, 2024
1 parent cb0ab9b commit 358c3cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions cmd/daemon/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,22 @@ func buildImportCmd(parentCmd *cobra.Command) {
}

sort.Slice(metadata, func(i, j int) bool {
return i > j
return i > j //nolint
})

Check warning on line 85 in cmd/daemon/import.go

View check run for this annotation

Codecov / codecov/patch

cmd/daemon/import.go#L83-L85

Added lines #L83 - L85 were not covered by tests

cmd.PrintLine()

Check warning on line 87 in cmd/daemon/import.go

View check run for this annotation

Codecov / codecov/patch

cmd/daemon/import.go#L87

Added line #L87 was not covered by tests

for i, m := range metadata {
fmt.Printf("%d. snapshot %s (%s)\n", i+1,
fmt.Printf("%d. snapshot %s (%s)\n", //nolint
i+1,
parseDate(m.CreatedAt),
util.FormatBytesToHumanReadable(uint64(m.TotalSize)))

Check warning on line 93 in cmd/daemon/import.go

View check run for this annotation

Codecov / codecov/patch

cmd/daemon/import.go#L90-L93

Added lines #L90 - L93 were not covered by tests
}

cmd.PrintLine()

Check warning on line 96 in cmd/daemon/import.go

View check run for this annotation

Codecov / codecov/patch

cmd/daemon/import.go#L96

Added line #L96 was not covered by tests

var choice int
fmt.Printf("Please select a snapshot [1-%d]: ", len(metadata))
fmt.Printf("Please select a snapshot [1-%d]: ", len(metadata)) //nolint
_, err = fmt.Scanf("%d", &choice)
cmd.FatalErrorCheck(err)

Check warning on line 101 in cmd/daemon/import.go

View check run for this annotation

Codecov / codecov/patch

cmd/daemon/import.go#L98-L101

Added lines #L98 - L101 were not covered by tests

Expand Down Expand Up @@ -161,7 +162,7 @@ func downloadProgressBar(fileName string, totalSize, downloaded int64, percentag
util.FormatBytesToHumanReadable(uint64(totalSize)),
)

Check warning on line 163 in cmd/daemon/import.go

View check run for this annotation

Codecov / codecov/patch

cmd/daemon/import.go#L155-L163

Added lines #L155 - L163 were not covered by tests

fmt.Print(progressBar)
fmt.Print(progressBar) //nolint

Check warning on line 165 in cmd/daemon/import.go

View check run for this annotation

Codecov / codecov/patch

cmd/daemon/import.go#L165

Added line #L165 was not covered by tests
}

func parseDate(dateString string) string {
Expand Down
2 changes: 1 addition & 1 deletion cmd/downlaod_mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func ExtractAndStoreFile(zipFilePath, extractPath string) error {
return fmt.Errorf("failed to open file in zip archive: %w", err)

Check warning on line 136 in cmd/downlaod_mgr.go

View check run for this annotation

Codecov / codecov/patch

cmd/downlaod_mgr.go#L134-L136

Added lines #L134 - L136 were not covered by tests
}

fpath := filepath.Join(extractPath, f.Name)
fpath := fmt.Sprintf("%s/%s", extractPath, f.Name)

Check warning on line 139 in cmd/downlaod_mgr.go

View check run for this annotation

Codecov / codecov/patch

cmd/downlaod_mgr.go#L139

Added line #L139 was not covered by tests

outFile, err := os.Create(fpath)
if err != nil {
Expand Down

0 comments on commit 358c3cb

Please sign in to comment.