Fix lint errors and bump golangci-lint to v2/action v9
CI / Test (linux/amd64) (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Cross-build (darwin/amd64) (push) Waiting to run
CI / Cross-build (linux/amd64) (push) Waiting to run
CI / Cross-build (darwin/arm64) (push) Waiting to run
CI / Cross-build (linux/arm64) (push) Waiting to run

- Migrate .golangci.yml to golangci-lint v2 config format
- Bump golangci-lint-action from v6 (Node 20, deprecated) to v9 (Node 24)
- Fix errcheck: check fmt.Fscanln and fmt.Sscanf return values
- Fix ineffassign: replace unused vars with _ in test files
- Fix revive unused-parameter: rename unused cmd/args/r/c params to _
- Fix revive empty-block: invert if condition in push command
- Fix revive redefines-builtin-id: rename 'clear' to 'clearsigned'
- Fix revive blank-imports: add comment on modernc.org/sqlite import
- Fix unused: remove unused 'suite' and 'gen' fields from cache entry
This commit is contained in:
2026-06-28 17:07:50 -05:00
parent f7ccf67b8a
commit c5e64cf63f
19 changed files with 84 additions and 71 deletions
+4 -4
View File
@@ -136,11 +136,11 @@ func TestListPackages_FiltersAndPagination(t *testing.T) {
}
// Filter by arch (matches arch OR 'all').
list, total, _ = s.ListPackages(ctx, repo.ID, d.ID, PackageFilters{Arch: "amd64"}, 1, 100)
_, total, _ = s.ListPackages(ctx, repo.ID, d.ID, PackageFilters{Arch: "amd64"}, 1, 100)
if total != 3 { // alpha, beta, delta
t.Fatalf("amd64 filter: expected 3, got %d", total)
}
list, total, _ = s.ListPackages(ctx, repo.ID, d.ID, PackageFilters{Arch: "arm64"}, 1, 100)
_, total, _ = s.ListPackages(ctx, repo.ID, d.ID, PackageFilters{Arch: "arm64"}, 1, 100)
if total != 2 { // gamma, epsilon
t.Fatalf("arm64 filter: expected 2, got %d", total)
}
@@ -152,7 +152,7 @@ func TestListPackages_FiltersAndPagination(t *testing.T) {
}
// Query (LIKE on name/description).
list, total, _ = s.ListPackages(ctx, repo.ID, d.ID, PackageFilters{Query: "a test"}, 1, 100)
_, total, _ = s.ListPackages(ctx, repo.ID, d.ID, PackageFilters{Query: "a test"}, 1, 100)
if total != 5 {
t.Fatalf("query filter: expected all 5 to match description, got %d", total)
}
@@ -163,7 +163,7 @@ func TestListPackages_FiltersAndPagination(t *testing.T) {
t.Fatalf("page 1: total=%d len=%d", total, len(list))
}
// page 3 -> only 1 item.
list, total, _ = s.ListPackages(ctx, repo.ID, d.ID, PackageFilters{}, 3, 2)
list, _, _ = s.ListPackages(ctx, repo.ID, d.ID, PackageFilters{}, 3, 2)
if len(list) != 1 {
t.Fatalf("page 3: expected 1 item, got %d", len(list))
}